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 = {
run(ed) {
if (!ed.Canvas.hasFocus()) return;
run(ed, snd, opts = {}) {
if (!ed.Canvas.hasFocus() && !opts.force) return;
const toSelect = [];
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) {
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')) {

Loading…
Cancel
Save