Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix aftercommand callback

  • Loading branch information...
commit 6504d2f7e2676dd3356cfcb721ab2655026c2c75 1 parent 239b508
@mixonic mixonic authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/commands.js
View
10 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(
}
}
}
-});
+});
Please sign in to comment.
Something went wrong with that request. Please try again.