|
|
|
@ -32462,12 +32462,12 @@ module.exports = Backbone.View.extend({ |
|
|
|
var model = this.model; |
|
|
|
var context = model.get('context'); |
|
|
|
var parent = this.parentM; |
|
|
|
var command = null; |
|
|
|
var command = {}; |
|
|
|
var editor = this.em && this.em.get ? this.em.get('Editor') : null; |
|
|
|
var commandName = model.get('command'); |
|
|
|
|
|
|
|
if (this.commands && (0, _underscore.isString)(commandName)) { |
|
|
|
command = this.commands.get(commandName); |
|
|
|
command = this.commands.get(commandName) || {}; |
|
|
|
} else if ((0, _underscore.isFunction)(commandName)) { |
|
|
|
command = { run: commandName }; |
|
|
|
} else if (commandName !== null && (0, _underscore.isObject)(commandName)) { |
|
|
|
@ -32479,7 +32479,7 @@ module.exports = Backbone.View.extend({ |
|
|
|
model.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')); |
|
|
|
editor.trigger('run:' + commandName); |
|
|
|
} |
|
|
|
@ -32491,7 +32491,7 @@ module.exports = Backbone.View.extend({ |
|
|
|
model.collection.deactivateAll(context); |
|
|
|
parent && parent.set('active', false, { silent: true }).trigger('checkActive'); |
|
|
|
|
|
|
|
if (command && command.stop) { |
|
|
|
if (command.stop) { |
|
|
|
command.stop(editor, model, model.get('options')); |
|
|
|
editor.trigger('stop:' + commandName); |
|
|
|
} |
|
|
|
|