Issue #290: change boolean flag name to isMovingContent in BaseSelect

This commit is contained in:
Julian Descottes 2016-07-30 23:59:24 +02:00 committed by juliandescottes
parent 0d1210e71f
commit 0d5dc21a41
2 changed files with 5 additions and 12 deletions

View File

@ -16,14 +16,7 @@
ns.AbstractDragSelect.prototype.onSelectStart_ = function (col, row, frame, overlay) { ns.AbstractDragSelect.prototype.onSelectStart_ = function (col, row, frame, overlay) {
if (this.hasSelection) { if (this.hasSelection) {
this.hasSelection = false; this.hasSelection = false;
this.dismissSelection();
if (this.dragMode_) {
$.publish(Events.SELECTION_PASTE);
this.dragMode_ = false;
}
overlay.clear();
$.publish(Events.SELECTION_DISMISSED);
} else { } else {
this.hasSelection = true; this.hasSelection = true;
this.onDragSelectStart_(col, row); this.onDragSelectStart_(col, row);

View File

@ -49,8 +49,8 @@
this.onSelectStart_(col, row, frame, overlay); this.onSelectStart_(col, row, frame, overlay);
} else { } else {
this.mode = 'moveSelection'; this.mode = 'moveSelection';
if (event.shiftKey && !this.dragMode_) { if (event.shiftKey && !this.isMovingContent_) {
this.dragMode_ = true; this.isMovingContent_ = true;
$.publish(Events.SELECTION_CUT); $.publish(Events.SELECTION_CUT);
} }
this.onSelectionMoveStart_(col, row, frame, overlay); this.onSelectionMoveStart_(col, row, frame, overlay);
@ -112,9 +112,9 @@
* Protected method, should be called when the selection is dismissed. * Protected method, should be called when the selection is dismissed.
*/ */
ns.BaseSelect.prototype.dismissSelection = function () { ns.BaseSelect.prototype.dismissSelection = function () {
if (this.dragMode_) { if (this.isMovingContent_) {
$.publish(Events.SELECTION_PASTE); $.publish(Events.SELECTION_PASTE);
this.dragMode_ = false; this.isMovingContent_ = false;
} }
// Clean previous selection: // Clean previous selection: