diff --git a/src/commands/index.js b/src/commands/index.js index f690aadb2..bee7c7bc1 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -371,6 +371,7 @@ module.exports = () => { * @private * */ create(command) { + if (!command.stop) command.noStop = 1; const cmd = CommandAbstract.extend(command); return new cmd(c); } diff --git a/src/panels/view/ButtonView.js b/src/panels/view/ButtonView.js index 7e83ddc4c..67173af93 100644 --- a/src/panels/view/ButtonView.js +++ b/src/panels/view/ButtonView.js @@ -97,8 +97,8 @@ module.exports = Backbone.View.extend({ model.set('active', true, { silent: true }).trigger('checkActive'); commands.runCommand(command, { ...options, sender: model }); - // Disable button if the command was just a function - cmdIsFunc && model.set('active', false); + // Disable button if the command has no stop method + command.noStop && model.set('active', false); } else { this.$el.removeClass(this.activeCls); model.collection.deactivateAll(context);