Browse Source

Add the possibility to force the command

pull/1800/head
Artur Arseniev 8 years ago
parent
commit
026774df8d
  1. 4
      src/commands/index.js
  2. 4
      src/commands/view/SelectComponent.js

4
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);
}

4
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

Loading…
Cancel
Save