From 026774df8dc67124f7b727cdfab1041860f11981 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 28 Jan 2019 23:22:04 +0100 Subject: [PATCH] Add the possibility to force the command --- src/commands/index.js | 4 ++-- src/commands/view/SelectComponent.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/index.js b/src/commands/index.js index 934f778e9..804136b6f 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -345,7 +345,7 @@ module.exports = () => { const id = command.id; const editor = em.get('Editor'); - if (!this.isActive(id)) { + if (!this.isActive(id) || options.force) { if (id && command.stop && !command.noStop) { active[id] = result; } @@ -370,7 +370,7 @@ module.exports = () => { const id = command.id; const editor = em.get('Editor'); - if (this.isActive(id)) { + if (this.isActive(id) || options.force) { if (id) delete active[id]; result = command.callStop(editor, options); } diff --git a/src/commands/view/SelectComponent.js b/src/commands/view/SelectComponent.js index 4a1732b40..8b5b57e37 100644 --- a/src/commands/view/SelectComponent.js +++ b/src/commands/view/SelectComponent.js @@ -178,7 +178,6 @@ module.exports = { onClick(e) { e.stopPropagation(); const $el = $(e.target); - const editor = this.editor; let model = $el.data('model'); if (!model) { @@ -475,7 +474,8 @@ module.exports = { if (typeof resizable == 'object') { options = { ...options, ...resizable }; } - editor.runCommand('resize', { el, options }); + + editor.runCommand('resize', { el, options, force: 1 }); // On undo/redo the resizer rect is not updating, need somehow to call // this.updateRect on undo/redo action