diff --git a/core/block_svg.js b/core/block_svg.js index 021c83dbc..f4e172581 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -130,7 +130,7 @@ Blockly.BlockSvg.prototype.initSvg = function() { Blockly.bindEventWithChecks_(this.getSvgRoot(), 'mousedown', this, this.onMouseDown_); var thisBlock = this; - Blockly.bindEventWithChecks_(this.getSvgRoot(), 'touchstart', null, + Blockly.bindEvent_(this.getSvgRoot(), 'touchstart', null, function(e) {Blockly.longStart_(e, thisBlock);}); } this.eventsInit_ = true; diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 80fe7e38f..b4c47837a 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -263,7 +263,7 @@ Blockly.WorkspaceSvg.prototype.createDom = function(opt_backgroundClass) { Blockly.bindEventWithChecks_(this.svgGroup_, 'mousedown', this, this.onMouseDown_); var thisWorkspace = this; - Blockly.bindEventWithChecks_(this.svgGroup_, 'touchstart', null, + Blockly.bindEvent_(this.svgGroup_, 'touchstart', null, function(e) {Blockly.longStart_(e, thisWorkspace);}); if (this.options.zoomOptions && this.options.zoomOptions.wheel) { // Mouse-wheel. @@ -765,6 +765,9 @@ Blockly.WorkspaceSvg.prototype.onMouseDown_ = function(e) { Blockly.onMouseMoveWrapper_ = Blockly.onMouseMoveWrapper_.concat( Blockly.bindEventWithChecks_(document, 'mousemove', null, Blockly.onMouseMove_)); + } else { + // It was a click, but the workspace isn't draggable. + Blockly.Touch.clearTouchIdentifier(); } // This event has been handled. No need to bubble up to the document. e.stopPropagation();