From 6504d2f7e2676dd3356cfcb721ab2655026c2c75 Mon Sep 17 00:00:00 2001 From: Matthew Beale Date: Mon, 14 May 2012 17:18:51 -0400 Subject: [PATCH] Fix aftercommand callback --- src/commands.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/commands.js b/src/commands.js index 02c62b47..4e970bc1 100644 --- a/src/commands.js +++ b/src/commands.js @@ -34,21 +34,23 @@ wysihtml5.Commands = Base.extend( exec: function(command, value) { var obj = wysihtml5.commands[command], args = wysihtml5.lang.array(arguments).get(), - method = obj && obj.exec; + method = obj && obj.exec, + result = null; this.editor.fire("beforecommand:composer"); if (method) { args.unshift(this.composer); - return method.apply(obj, args); + result = method.apply(obj, args); } else { try { // try/catch for buggy firefox - return this.doc.execCommand(command, false, value); + result = this.doc.execCommand(command, false, value); } catch(e) {} } this.editor.fire("aftercommand:composer"); + return result; }, /** @@ -100,4 +102,4 @@ wysihtml5.Commands = Base.extend( } } } -}); \ No newline at end of file +});