From 6ee735ee6ec06360060d7b0b4887a959a46af62c Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Wed, 5 Oct 2016 17:03:33 -0700 Subject: [PATCH 1/2] Fix angle picker with new touch code --- core/field_angle.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/field_angle.js b/core/field_angle.js index 74e767f90..698bac234 100644 --- a/core/field_angle.js +++ b/core/field_angle.js @@ -168,11 +168,11 @@ Blockly.FieldAngle.prototype.showEditor_ = function() { } svg.style.marginLeft = (15 - Blockly.FieldAngle.RADIUS) + 'px'; this.clickWrapper_ = - Blockly.bindEventWithChecks_(svg, 'click', this, Blockly.WidgetDiv.hide); + Blockly.bindEvent_(svg, 'click', this, Blockly.WidgetDiv.hide); this.moveWrapper1_ = - Blockly.bindEventWithChecks_(circle, 'mousemove', this, this.onMouseMove); + Blockly.bindEvent_(circle, 'mousemove', this, this.onMouseMove); this.moveWrapper2_ = - Blockly.bindEventWithChecks_(this.gauge_, 'mousemove', this, + Blockly.bindEvent_(this.gauge_, 'mousemove', this, this.onMouseMove); this.updateGraph_(); }; From e01e320205e08e54eeacc3c4987d8a2f35ad02cd Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Thu, 6 Oct 2016 12:43:33 -0700 Subject: [PATCH 2/2] Add comment --- core/field_angle.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/field_angle.js b/core/field_angle.js index 698bac234..5bea3cbc1 100644 --- a/core/field_angle.js +++ b/core/field_angle.js @@ -167,6 +167,11 @@ Blockly.FieldAngle.prototype.showEditor_ = function() { }, svg); } svg.style.marginLeft = (15 - Blockly.FieldAngle.RADIUS) + 'px'; + + // The angle picker is different from other fields in that it updates on + // mousemove even if it's not in the middle of a drag. In future we may + // change this behavior. For now, using bindEvent_ instead of + // bindEventWithChecks_ allows it to work without a mousedown/touchstart. this.clickWrapper_ = Blockly.bindEvent_(svg, 'click', this, Blockly.WidgetDiv.hide); this.moveWrapper1_ =