Fix bug in trashcan (#4306)

This commit is contained in:
alschmiedt
2020-09-22 16:35:22 -07:00
committed by GitHub
parent f66bfb220a
commit 3969f3129f

View File

@@ -311,8 +311,6 @@ Blockly.Trashcan.prototype.createDom = function() {
this.svgLid_.setAttributeNS(Blockly.utils.dom.XLINK_NS, 'xlink:href',
this.workspace_.options.pathToMedia + Blockly.SPRITE.url);
Blockly.bindEventWithChecks_(
this.svgGroup_, 'mousedown', this, this.blockMouseDownWhenFull_);
Blockly.bindEventWithChecks_(this.svgGroup_, 'mouseup', this, this.click);
// bindEventWithChecks_ quashes events too aggressively. See:
// https://groups.google.com/forum/#!topic/blockly/QF4yB9Wx00s
@@ -566,18 +564,6 @@ Blockly.Trashcan.prototype.fireUiEvent_ = function(trashcanOpen) {
Blockly.Events.fire(uiEvent);
};
/**
* Prevents a workspace scroll and click event if the trashcan has blocks.
* @param {!Event} e A mouse down event.
* @private
*/
Blockly.Trashcan.prototype.blockMouseDownWhenFull_ = function(e) {
if (this.hasContents_()) {
e.stopPropagation(); // Don't start a workspace scroll.
}
};
/**
* Indicate that the trashcan can be clicked (by opening it) if it has blocks.
* @private