X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/68c9d615c3b5f4d6fefcd721f0315fde89fc3328..e6993e4bfe0e5fd38ccf554da489b5af3625c2fb:/src/editor/plugins/core/switch.js diff --git a/src/editor/plugins/core/switch.js b/src/editor/plugins/core/switch.js index 2403c2b..2730761 100644 --- a/src/editor/plugins/core/switch.js +++ b/src/editor/plugins/core/switch.js @@ -16,7 +16,8 @@ var createSwitchAction = function(createParams) { var state = { label: this.config.label }, - f = params.fragment; + f = params.fragment, + description; if( @@ -37,10 +38,11 @@ var createSwitchAction = function(createParams) { toSwitch = toSwitch.getParent(createParams.from); } + description = 'Switch to ' + createParams.to.name; return _.extend(state, { allowed: !!toSwitch, toggled: alreadyInTarget, - description: 'Switch to ' + createParams.to.name, + description: description, execute: alreadyInTarget ? function() {} : function() { f.document.transaction(function() { if(createParams.to.tagName) { @@ -49,6 +51,10 @@ var createSwitchAction = function(createParams) { if(!_.isUndefined(createParams.to.klass)) { toSwitch.setClass(createParams.to.klass); } + }, { + metadata: { + description: description + } }); } });