- command: function(command, params) {
- commands.run(command, params, canvas, sandbox.getConfig().user);
+ onAfterActionExecuted: function(action, ret) {
+ if(ret && ret instanceof canvas.wlxmlDocument.CaretFragment && ret.isValid()) {
+ logger.debug('The action returned a valid fragment');
+ canvas.setCurrentElement(ret.node, {caretTo: ret.offset});
+ return;
+ }
+ logger.debug('No valid fragment returned from the action');
+
+ (actionHandlers[action.getPluginName()] || []).forEach(function(handler) {
+ handler(canvas, action, ret);
+ });