From 0bd4ac2fe82c90b72710cd70468d88a8264a8dde Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 17 Feb 2019 20:09:18 +0100 Subject: [PATCH] Update toggleDrag --- src/commands/index.js | 1 - src/commands/view/ComponentDrag.js | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commands/index.js b/src/commands/index.js index 476eb3f19..ecb64a398 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -143,7 +143,6 @@ module.exports = () => { // TODO move grabbing func in editor/canvas from the Sorter dragger = editor.runCommand('core:component-drag', { target: sel, - el: sel.view.el, options: { event, onEnd diff --git a/src/commands/view/ComponentDrag.js b/src/commands/view/ComponentDrag.js index 09b104a26..33ba89075 100644 --- a/src/commands/view/ComponentDrag.js +++ b/src/commands/view/ComponentDrag.js @@ -51,7 +51,7 @@ module.exports = { }, setPosition }; - + this.editor = editor; let dragger = this.dragger; if (!dragger) { @@ -71,11 +71,12 @@ module.exports = { this.toggleDrag(); }, - toggleDrag(enable) { - const { ppfx } = this; - const methodCls = enable ? 'add' : 'remove'; + toggleDrag(on) { + const { ppfx, editor } = this; + const methodCls = on ? 'add' : 'remove'; const canvas = this.getCanvas(); const classes = [`${ppfx}is__grabbing`]; classes.forEach(cls => canvas.classList[methodCls](cls)); + editor.Canvas[on ? 'startAutoscroll' : 'stopAutoscroll'](); } };