mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
Get rid of unnecessary nulls in block dragger, insertion marker manager, and gesture dispose functions.
This commit is contained in:
@@ -100,14 +100,10 @@ Blockly.BlockDragger = function(block, workspace) {
|
||||
* @package
|
||||
*/
|
||||
Blockly.BlockDragger.prototype.dispose = function() {
|
||||
this.draggingBlock_ = null;
|
||||
this.workspace_ = null;
|
||||
this.startWorkspace_ = null;
|
||||
this.dragIconData_.length = 0;
|
||||
|
||||
if (this.draggedConnectionManager_) {
|
||||
this.draggedConnectionManager_.dispose();
|
||||
this.draggedConnectionManager_ = null;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -250,24 +250,14 @@ Blockly.Gesture.prototype.dispose = function() {
|
||||
Blockly.unbindEvent_(this.onUpWrapper_);
|
||||
}
|
||||
|
||||
|
||||
this.startField_ = null;
|
||||
this.startBlock_ = null;
|
||||
this.targetBlock_ = null;
|
||||
this.startWorkspace_ = null;
|
||||
this.flyout_ = null;
|
||||
|
||||
if (this.blockDragger_) {
|
||||
this.blockDragger_.dispose();
|
||||
this.blockDragger_ = null;
|
||||
}
|
||||
if (this.workspaceDragger_) {
|
||||
this.workspaceDragger_.dispose();
|
||||
this.workspaceDragger_ = null;
|
||||
}
|
||||
if (this.bubbleDragger_) {
|
||||
this.bubbleDragger_.dispose();
|
||||
this.bubbleDragger_ = null;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -146,27 +146,19 @@ Blockly.InsertionMarkerManager = function(block) {
|
||||
* @package
|
||||
*/
|
||||
Blockly.InsertionMarkerManager.prototype.dispose = function() {
|
||||
this.topBlock_ = null;
|
||||
this.workspace_ = null;
|
||||
this.availableConnections_.length = 0;
|
||||
this.closestConnection_ = null;
|
||||
this.localConnection_ = null;
|
||||
|
||||
Blockly.Events.disable();
|
||||
try {
|
||||
if (this.firstMarker_) {
|
||||
this.firstMarker_.dispose();
|
||||
this.firstMarker_ = null;
|
||||
}
|
||||
if (this.lastMarker_) {
|
||||
this.lastMarker_.dispose();
|
||||
this.lastMarker_ = null;
|
||||
}
|
||||
} finally {
|
||||
Blockly.Events.enable();
|
||||
}
|
||||
|
||||
this.highlightedBlock_ = null;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user