Browse Source

Prevent propagation with toolbar buttons

pull/330/head
Artur Arseniev 9 years ago
parent
commit
f6d8f10a4d
  1. 11
      src/dom_components/view/ToolbarButtonView.js

11
src/dom_components/view/ToolbarButtonView.js

@ -14,15 +14,18 @@ module.exports = Backbone.View.extend({
}, },
handleClick(event) { handleClick(event) {
var opts = {event}; event.preventDefault();
var command = this.model.get('command'); event.stopPropagation();
const opts = {event};
const command = this.model.get('command');
const editor = this.editor;
if (typeof command === 'function') { if (typeof command === 'function') {
command(this.editor, null, opts); command(editor, null, opts);
} }
if (typeof command === 'string') { if (typeof command === 'string') {
this.editor.runCommand(command, opts); editor.runCommand(command, opts);
} }
}, },

Loading…
Cancel
Save