Don't delete undeletable blocks dragged onto a delete area (issue 52).

This commit is contained in:
Neil Fraser
2015-01-28 13:30:26 -08:00
parent cf88bd1756
commit 67963f7293
2 changed files with 4 additions and 3 deletions

View File

@@ -405,7 +405,8 @@ Blockly.BlockSvg.prototype.onMouseUp_ = function(e) {
// Don't throw an object in the trash can if it just got connected.
this_.workspace.trashcan.close();
}
} else if (this_.workspace.isDeleteArea(e)) {
} else if (this_.workspace.isDeleteArea(e) &&
Blockly.selected.isDeletable()) {
var trashcan = this_.workspace.trashcan;
if (trashcan) {
goog.Timer.callOnce(trashcan.close, 100, trashcan);