Merge pull request #2359 from alschmiedt/Hide_chaff_bug

Hides chaff on document mouseup
This commit is contained in:
alschmiedt
2019-04-04 14:08:55 -07:00
committed by GitHub

View File

@@ -420,6 +420,11 @@ Blockly.init_ = function(mainWorkspace) {
*/
Blockly.inject.bindDocumentEvents_ = function() {
if (!Blockly.documentEventsBound_) {
document.addEventListener('mouseup', function() {
Blockly.hideChaff();
Blockly.Touch.clearTouchIdentifier(); // Don't block future drags.
}, false);
Blockly.bindEventWithChecks_(document, 'scroll', null, function() {
var workspaces = Blockly.Workspace.getAll();
for (var i = 0, workspace; workspace = workspaces[i]; i++) {