X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/bb204203f5f64dd13b256263fd398e1463d4eaf9..695d1a0067346347cf36bedab8fdce7ae39d5270:/src/editor/plugins/core/switch.js diff --git a/src/editor/plugins/core/switch.js b/src/editor/plugins/core/switch.js index edb8e95..88544bf 100644 --- a/src/editor/plugins/core/switch.js +++ b/src/editor/plugins/core/switch.js @@ -55,7 +55,8 @@ var createSwitchAction = function(createParams) { return f.document.createFragment(f.CaretFragment, {node: f.document.getNodeByPath(textNodePath), offset: f.offset}); }, { metadata: { - description: description + description: description, + fragment: params.fragment }, success: callback }); @@ -66,12 +67,13 @@ var createSwitchAction = function(createParams) { }; var headerAction = createSwitchAction({name: 'switchToHeader', from: {tagName: 'div', klass: 'p'}, to: {tagName: 'header', klass: '', name: gettext('header')}}), - paragraphAction = createSwitchAction({name: 'switchToParagraph', from: {tagName: 'header'}, to: {tagName: 'div', klass: 'p', name: gettext('paragraf')}}); + paragraphAction = createSwitchAction({name: 'switchToParagraph', from: {tagName: 'header'}, to: {tagName: 'div', klass: 'p', name: gettext('paragraph')}}), + imageAction = createSwitchAction({name: 'switchToImage', from: {tagName: 'div'}, to: {tagName: 'div', klass: 'img', name: gettext('image')}}); return { - actions: [headerAction, paragraphAction], + actions: [headerAction, paragraphAction, imageAction], canvasActionHandler: { - handles: [headerAction, paragraphAction], + handles: [headerAction, paragraphAction, imageAction], // handle: function(canvas, action, ret) { // var params = {}, // f;