From 0d5dc21a4187d038a14f650d7d3c07d3d96d67c9 Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Sat, 30 Jul 2016 23:59:24 +0200 Subject: [PATCH] Issue #290: change boolean flag name to isMovingContent in BaseSelect --- src/js/tools/drawing/selection/AbstractDragSelect.js | 9 +-------- src/js/tools/drawing/selection/BaseSelect.js | 8 ++++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/js/tools/drawing/selection/AbstractDragSelect.js b/src/js/tools/drawing/selection/AbstractDragSelect.js index 4a27fb9e..59872e62 100644 --- a/src/js/tools/drawing/selection/AbstractDragSelect.js +++ b/src/js/tools/drawing/selection/AbstractDragSelect.js @@ -16,14 +16,7 @@ ns.AbstractDragSelect.prototype.onSelectStart_ = function (col, row, frame, overlay) { if (this.hasSelection) { this.hasSelection = false; - - if (this.dragMode_) { - $.publish(Events.SELECTION_PASTE); - this.dragMode_ = false; - } - - overlay.clear(); - $.publish(Events.SELECTION_DISMISSED); + this.dismissSelection(); } else { this.hasSelection = true; this.onDragSelectStart_(col, row); diff --git a/src/js/tools/drawing/selection/BaseSelect.js b/src/js/tools/drawing/selection/BaseSelect.js index 9be22f36..7f1552a2 100644 --- a/src/js/tools/drawing/selection/BaseSelect.js +++ b/src/js/tools/drawing/selection/BaseSelect.js @@ -49,8 +49,8 @@ this.onSelectStart_(col, row, frame, overlay); } else { this.mode = 'moveSelection'; - if (event.shiftKey && !this.dragMode_) { - this.dragMode_ = true; + if (event.shiftKey && !this.isMovingContent_) { + this.isMovingContent_ = true; $.publish(Events.SELECTION_CUT); } this.onSelectionMoveStart_(col, row, frame, overlay); @@ -112,9 +112,9 @@ * Protected method, should be called when the selection is dismissed. */ ns.BaseSelect.prototype.dismissSelection = function () { - if (this.dragMode_) { + if (this.isMovingContent_) { $.publish(Events.SELECTION_PASTE); - this.dragMode_ = false; + this.isMovingContent_ = false; } // Clean previous selection: