From: Jan Szejko Date: Thu, 9 Feb 2017 13:36:10 +0000 (+0100) Subject: allow switch from any to image/video X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/e99c67c2ec195bc34e345616a054966b6cc1554f allow switch from any to image/video --- diff --git a/src/editor/plugins/core/switch.js b/src/editor/plugins/core/switch.js index e3ec5c4..2c1e8b0 100644 --- a/src/editor/plugins/core/switch.js +++ b/src/editor/plugins/core/switch.js @@ -10,7 +10,7 @@ var createSwitchAction = function(createParams) { return { name: createParams.name, params: { - fragment: {type: 'context', name: 'fragment'}, + fragment: {type: 'context', name: 'fragment'} }, getState: function(params) { var state = { @@ -68,8 +68,8 @@ 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('paragraph')}}), - imageAction = createSwitchAction({name: 'switchToImage', from: {tagName: 'div'}, to: {tagName: 'div', klass: 'img', name: gettext('image')}}), - videoAction = createSwitchAction({name: 'switchToVideo', from: {tagName: 'div'}, to: {tagName: 'div', klass: 'video', name: gettext('video')}}); + imageAction = createSwitchAction({name: 'switchToImage', from: {}, to: {tagName: 'div', klass: 'img', name: gettext('image')}}), + videoAction = createSwitchAction({name: 'switchToVideo', from: {}, to: {tagName: 'div', klass: 'video', name: gettext('video')}}); return { actions: [headerAction, paragraphAction, imageAction, videoAction],