mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Fixed multiple trashcans on the same page leaking state.
This commit is contained in:
@@ -37,7 +37,28 @@ goog.require('goog.math.Rect');
|
||||
* @constructor
|
||||
*/
|
||||
Blockly.Trashcan = function(workspace) {
|
||||
/**
|
||||
* The workspace the trashcan sits in.
|
||||
* @type {!Blockly.Workspace}
|
||||
* @private
|
||||
*/
|
||||
this.workspace_ = workspace;
|
||||
|
||||
/**
|
||||
* True if the trashcan contains blocks, otherwise false.
|
||||
* @type {boolean}
|
||||
* @private
|
||||
*/
|
||||
this.hasBlocks_ = false;
|
||||
|
||||
/**
|
||||
* A list of Xml (stored as strings) representing blocks "inside" the trashcan.
|
||||
* @type {Array}
|
||||
* @private
|
||||
*/
|
||||
this.contents_ = [];
|
||||
|
||||
|
||||
if (this.workspace_.options.maxTrashcanContents <= 0) {
|
||||
return;
|
||||
}
|
||||
@@ -142,20 +163,6 @@ Blockly.Trashcan.prototype.isOpen = false;
|
||||
*/
|
||||
Blockly.Trashcan.prototype.minOpenness_ = 0;
|
||||
|
||||
/**
|
||||
* True if the trashcan contains blocks, otherwise false.
|
||||
* @type {boolean}
|
||||
* @private
|
||||
*/
|
||||
Blockly.Trashcan.prototype.hasBlocks_ = false;
|
||||
|
||||
/**
|
||||
* A list of Xml (stored as strings) representing blocks "inside" the trashcan.
|
||||
* @type {Array}
|
||||
* @private
|
||||
*/
|
||||
Blockly.Trashcan.prototype.contents_ = [];
|
||||
|
||||
/**
|
||||
* The SVG group containing the trash can.
|
||||
* @type {Element}
|
||||
|
||||
Reference in New Issue
Block a user