description = gettext('Switch to') + ' ' + createParams.to.name;
return _.extend(state, {
- allowed: !!toSwitch,
+ allowed: !!toSwitch || alreadyInTarget,
toggled: alreadyInTarget,
description: description,
execute: alreadyInTarget ? function() {} : function(callback) {
return f.document.createFragment(f.CaretFragment, {node: f.document.getNodeByPath(textNodePath), offset: f.offset});
}, {
metadata: {
- description: description
+ description: description,
+ fragment: params.fragment
},
success: callback
});