Browse Source

Hide the resizer on select component stop

pull/2062/head
Artur Arseniev 7 years ago
parent
commit
dd4fb0c2e9
  1. 7
      src/commands/index.js
  2. 5
      src/commands/view/SelectComponent.js

7
src/commands/index.js

@ -98,15 +98,10 @@ module.exports = () => {
const event = opts && opts.event; const event = opts && opts.event;
const sel = ed.getSelected(); const sel = ed.getSelected();
const selAll = [...ed.getSelectedAll()]; const selAll = [...ed.getSelectedAll()];
const toolbarStyle = ed.Canvas.getToolbarEl().style;
const nativeDrag = event && event.type == 'dragstart'; const nativeDrag = event && event.type == 'dragstart';
const defComOptions = { preserveSelected: 1 }; const defComOptions = { preserveSelected: 1 };
const modes = ['absolute', 'translate']; const modes = ['absolute', 'translate'];
const hideTlb = () => em.stopDefault(defComOptions);
const hideTlb = () => {
toolbarStyle.display = 'none';
em.stopDefault(defComOptions);
};
if (!sel || !sel.get('draggable')) { if (!sel || !sel.get('draggable')) {
console.warn('The element is not draggable'); console.warn('The element is not draggable');

5
src/commands/view/SelectComponent.js

@ -678,14 +678,15 @@ module.exports = {
this.onSelect(); this.onSelect();
}, },
stop(editor, sender, opts = {}) { stop(ed, sender, opts = {}) {
const em = this.em; const { em, editor } = this;
this.stopSelectComponent(); this.stopSelectComponent();
!opts.preserveSelected && em.setSelected(null); !opts.preserveSelected && em.setSelected(null);
this.clean(); this.clean();
this.onOut(); this.onOut();
this.hideFixedElementOffset(); this.hideFixedElementOffset();
this.canvas.getToolbarEl().style.display = 'none'; this.canvas.getToolbarEl().style.display = 'none';
editor && editor.stopCommand('resize');
em.off('component:update', this.updateAttached, this); em.off('component:update', this.updateAttached, this);
em.off('change:canvasOffset', this.updateAttached, this); em.off('change:canvasOffset', this.updateAttached, this);

Loading…
Cancel
Save