From cdc8797eac1d0a8608566795fe91e9c2d9758499 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 23 Apr 2019 07:54:26 +0200 Subject: [PATCH] Force component exit command in the toolbar --- src/commands/view/ComponentExit.js | 4 ++-- src/dom_components/model/Component.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/view/ComponentExit.js b/src/commands/view/ComponentExit.js index 8d01f9f0e..0367723c0 100644 --- a/src/commands/view/ComponentExit.js +++ b/src/commands/view/ComponentExit.js @@ -1,6 +1,6 @@ module.exports = { - run(ed) { - if (!ed.Canvas.hasFocus()) return; + run(ed, snd, opts = {}) { + if (!ed.Canvas.hasFocus() && !opts.force) return; const toSelect = []; ed.getSelectedAll().forEach(component => { diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index f6c0e6a5c..8dc36f140 100644 --- a/src/dom_components/model/Component.js +++ b/src/dom_components/model/Component.js @@ -611,7 +611,7 @@ const Component = Backbone.Model.extend(Styleable).extend( if (model.collection) { tb.push({ attributes: { class: 'fa fa-arrow-up' }, - command: 'core:component-exit' + command: ed => ed.runCommand('core:component-exit', { force: 1 }) }); } if (model.get('draggable')) {