Merge pull request #841 from rachel-fenichel/bugfix/long_stop_bind_event

Use bindEvent_ instead of bindEventWithChecks_ for longStop
This commit is contained in:
Rachel Fenichel
2017-01-19 10:29:15 -08:00
committed by GitHub

View File

@@ -339,9 +339,10 @@ Blockly.init_ = function(mainWorkspace) {
Blockly.inject.bindDocumentEvents_ = function() {
if (!Blockly.documentEventsBound_) {
Blockly.bindEventWithChecks_(document, 'keydown', null, Blockly.onKeyDown_);
Blockly.bindEventWithChecks_(document, 'touchend', null, Blockly.longStop_);
Blockly.bindEventWithChecks_(document, 'touchcancel', null,
Blockly.longStop_);
// longStop needs to run to stop the context menu from showing up. It
// should run regardless of what other touch event handlers have run.
Blockly.bindEvent_(document, 'touchend', null, Blockly.longStop_);
Blockly.bindEvent_(document, 'touchcancel', null, Blockly.longStop_);
// Don't use bindEvent_ for document's mouseup since that would create a
// corresponding touch handler that would squelch the ability to interact
// with non-Blockly elements.