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) {
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);

View File

@ -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: