Browse Source

Force component exit command in the toolbar

pull/2031/head
Artur Arseniev 7 years ago
parent
commit
cdc8797eac
  1. 4
      src/commands/view/ComponentExit.js
  2. 2
      src/dom_components/model/Component.js

4
src/commands/view/ComponentExit.js

@ -1,6 +1,6 @@
module.exports = { module.exports = {
run(ed) { run(ed, snd, opts = {}) {
if (!ed.Canvas.hasFocus()) return; if (!ed.Canvas.hasFocus() && !opts.force) return;
const toSelect = []; const toSelect = [];
ed.getSelectedAll().forEach(component => { ed.getSelectedAll().forEach(component => {

2
src/dom_components/model/Component.js

@ -611,7 +611,7 @@ const Component = Backbone.Model.extend(Styleable).extend(
if (model.collection) { if (model.collection) {
tb.push({ tb.push({
attributes: { class: 'fa fa-arrow-up' }, attributes: { class: 'fa fa-arrow-up' },
command: 'core:component-exit' command: ed => ed.runCommand('core:component-exit', { force: 1 })
}); });
} }
if (model.get('draggable')) { if (model.get('draggable')) {

Loading…
Cancel
Save