diff --git a/src/commands/index.js b/src/commands/index.js index 9991919d2..1df3a6e29 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -185,11 +185,10 @@ module.exports = () => { const cmdMove = ed.Commands.get('move-comp'); cmdMove.onEndMoveFromModel = onEnd; - // cmdMove.initSorterFromModel(sel); cmdMove.initSorterFromModels(selAll); } - sel.set('status', 'freezed-selected'); + selAll.forEach(sel => sel.set('status', 'freezed-selected')); } }; diff --git a/src/commands/view/MoveComponent.js b/src/commands/view/MoveComponent.js index 0a90b7dfb..abd747e3b 100644 --- a/src/commands/view/MoveComponent.js +++ b/src/commands/view/MoveComponent.js @@ -90,12 +90,11 @@ module.exports = _.extend({}, SelectPosition, SelectComponent, { // TODO: if one only check for `draggable` // Avoid badge showing on move this.cacheEl = null; - models = [...models]; const lastModel = models[models.length - 1]; const doc = this.frameEl.contentDocument; this.startSelectPosition(lastModel.view.el, doc); this.sorter.draggable = lastModel.get('draggable'); - this.sorter.toMove = models.reverse(); + this.sorter.toMove = models; this.sorter.onEndMove = this.onEndMoveFromModel.bind(this); this.stopSelectComponent(); on(this.getContentWindow(), 'keydown', this.rollback); diff --git a/src/commands/view/SelectComponent.js b/src/commands/view/SelectComponent.js index 248c390d7..6c384e6d0 100644 --- a/src/commands/view/SelectComponent.js +++ b/src/commands/view/SelectComponent.js @@ -221,8 +221,9 @@ module.exports = { const ctrlKey = event.ctrlKey || event.metaKey; const shiftKey = event.shiftKey; const { editor } = this; + const multiple = editor.getConfig('multipleSelection'); - if (ctrlKey) { + if (ctrlKey && multiple) { editor.selectToggle(model); // else if (shiftKey) // multiple selection } else { diff --git a/src/editor/config/config.js b/src/editor/config/config.js index 5183d1575..f5b446edc 100644 --- a/src/editor/config/config.js +++ b/src/editor/config/config.js @@ -105,6 +105,9 @@ module.exports = { // Enable native HTML5 drag and drop nativeDnD: 1, + // Enable multiple selection + multipleSelection: 1, + // Show the wrapper component in the final code, eg. in editor.getHtml() exportWrapper: 0,