diff --git a/core/block_dragger.js b/core/block_dragger.js index 8dfac65421e..b9ce831becb 100644 --- a/core/block_dragger.js +++ b/core/block_dragger.js @@ -217,12 +217,12 @@ Blockly.BlockDragger.prototype.dragBlock = function(e, currentDragDeltaXY) { } this.draggedConnectionManager_.update(delta, this.dragTarget_); - var wouldDeleteBlock = this.draggedConnectionManager_.wouldDeleteBlock(); - if (wouldDeleteBlock != this.wouldDeleteBlock_) { + var oldWouldDeleteBlock = this.wouldDeleteBlock_; + this.wouldDeleteBlock_ = this.draggedConnectionManager_.wouldDeleteBlock(); + if (oldWouldDeleteBlock != this.wouldDeleteBlock_) { // Prevent unnecessary add/remove class calls. this.updateCursorDuringBlockDrag_(); } - this.wouldDeleteBlock_ = wouldDeleteBlock; }; /** diff --git a/core/bubble_dragger.js b/core/bubble_dragger.js index 734445622fa..fd4b67b0042 100644 --- a/core/bubble_dragger.js +++ b/core/bubble_dragger.js @@ -142,12 +142,12 @@ Blockly.BubbleDragger.prototype.dragBubble = function(e, currentDragDeltaXY) { this.dragTarget_ && this.dragTarget_.onDragEnter(); } - var wouldDeleteBubble = this.shouldDelete_(this.dragTarget_); - if (wouldDeleteBubble != this.wouldDeleteBubble_) { + var oldWouldDeleteBubble = this.wouldDeleteBubble_; + this.wouldDeleteBubble_ = this.shouldDelete_(this.dragTarget_); + if (oldWouldDeleteBubble != this.wouldDeleteBubble_) { // Prevent unnecessary add/remove class calls. this.updateCursorDuringBubbleDrag_(); } - this.wouldDeleteBubble_ = wouldDeleteBubble; }; /**