From b3cd33d4406cfc5bfb6cb776c8362ff01d1aa4cf Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Thu, 25 Aug 2016 16:55:26 -0700 Subject: [PATCH] Reset cursor and touch identifier in the bubble instead of relying on Blockly.onMouseUp --- core/bubble.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/bubble.js b/core/bubble.js index d4c1e2719..37fd63ad5 100644 --- a/core/bubble.js +++ b/core/bubble.js @@ -144,6 +144,17 @@ Blockly.Bubble.unbindDragEvents_ = function() { } }; +/* + * Handle a mouse-up event while dragging a bubble's border. + * @param {!Event} e Mouse up event. + * @private + */ +Blockly.Bubble.bubbleMouseUp_ = function(e) { + Blockly.touchIdentifier_ = null; + Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN); + Blockly.Bubble.unbindDragEvents_(); +}; + /** * Flag to stop incremental rendering during construction. * @private @@ -275,7 +286,7 @@ Blockly.Bubble.prototype.bubbleMouseDown_ = function(e) { this.relativeTop_)); Blockly.Bubble.onMouseUpWrapper_ = Blockly.bindEvent_(document, - 'mouseup', this, Blockly.Bubble.unbindDragEvents_); + 'mouseup', this, Blockly.Bubble.bubbleMouseUp_); Blockly.Bubble.onMouseMoveWrapper_ = Blockly.bindEvent_(document, 'mousemove', this, this.bubbleMouseMove_); Blockly.hideChaff();