|
|
@ -203,7 +203,7 @@ module.exports = Backbone.View.extend({ |
|
|
const model = this.model; |
|
|
const model = this.model; |
|
|
const context = model.get('context'); |
|
|
const context = model.get('context'); |
|
|
const parent = this.parentM; |
|
|
const parent = this.parentM; |
|
|
var command = null; |
|
|
let command = {}; |
|
|
var editor = this.em && this.em.get ? this.em.get('Editor') : null; |
|
|
var editor = this.em && this.em.get ? this.em.get('Editor') : null; |
|
|
var commandName = model.get('command'); |
|
|
var commandName = model.get('command'); |
|
|
|
|
|
|
|
|
@ -220,7 +220,7 @@ module.exports = Backbone.View.extend({ |
|
|
model.set('active', true, { silent: true }).trigger('checkActive'); |
|
|
model.set('active', true, { silent: true }).trigger('checkActive'); |
|
|
parent && parent.set('active', true, { silent: true }).trigger('checkActive'); |
|
|
parent && parent.set('active', true, { silent: true }).trigger('checkActive'); |
|
|
|
|
|
|
|
|
if (command && command.run) { |
|
|
if (command.run) { |
|
|
command.run(editor, model, model.get('options')); |
|
|
command.run(editor, model, model.get('options')); |
|
|
editor.trigger('run:' + commandName); |
|
|
editor.trigger('run:' + commandName); |
|
|
} |
|
|
} |
|
|
@ -232,7 +232,7 @@ module.exports = Backbone.View.extend({ |
|
|
model.collection.deactivateAll(context); |
|
|
model.collection.deactivateAll(context); |
|
|
parent && parent.set('active', false, { silent: true }).trigger('checkActive'); |
|
|
parent && parent.set('active', false, { silent: true }).trigger('checkActive'); |
|
|
|
|
|
|
|
|
if (command && command.stop) { |
|
|
if (command.stop) { |
|
|
command.stop(editor, model, model.get('options')); |
|
|
command.stop(editor, model, model.get('options')); |
|
|
editor.trigger('stop:' + commandName); |
|
|
editor.trigger('stop:' + commandName); |
|
|
} |
|
|
} |
|
|
|