Merge pull request #3155 from rachel-fenichel/trashcan_visibility

Make trashcan setOpen package and update a few annotations.
This commit is contained in:
Rachel Fenichel
2019-10-04 15:55:15 -07:00
committed by GitHub
4 changed files with 13 additions and 13 deletions

View File

@@ -297,12 +297,12 @@ Blockly.BlockDragger.prototype.updateCursorDuringBlockDrag_ = function() {
if (this.wouldDeleteBlock_) {
this.draggingBlock_.setDeleteStyle(true);
if (this.deleteArea_ == Blockly.DELETE_AREA_TRASH && trashcan) {
trashcan.setOpen_(true);
trashcan.setOpen(true);
}
} else {
this.draggingBlock_.setDeleteStyle(false);
if (trashcan) {
trashcan.setOpen_(false);
trashcan.setOpen(false);
}
}
};

View File

@@ -178,12 +178,12 @@ Blockly.BubbleDragger.prototype.updateCursorDuringBubbleDrag_ = function() {
if (this.wouldDeleteBubble_) {
this.draggingBubble_.setDeleteStyle(true);
if (this.deleteArea_ == Blockly.DELETE_AREA_TRASH && trashcan) {
trashcan.setOpen_(true);
trashcan.setOpen(true);
}
} else {
this.draggingBubble_.setDeleteStyle(false);
if (trashcan) {
trashcan.setOpen_(false);
trashcan.setOpen(false);
}
}
};

View File

@@ -295,7 +295,7 @@ Blockly.Trashcan.prototype.init = function(verticalSpacing) {
}
this.verticalSpacing_ = this.MARGIN_BOTTOM_ + verticalSpacing;
this.setOpen_(false);
this.setOpen(false);
return this.verticalSpacing_ + this.BODY_HEIGHT_ + this.LID_HEIGHT_;
};
@@ -370,9 +370,9 @@ Blockly.Trashcan.prototype.getClientRect = function() {
/**
* Flip the lid open or shut.
* @param {boolean} state True if open.
* @private
* @package
*/
Blockly.Trashcan.prototype.setOpen_ = function(state) {
Blockly.Trashcan.prototype.setOpen = function(state) {
if (this.isOpen == state) {
return;
}
@@ -416,7 +416,7 @@ Blockly.Trashcan.prototype.setLidAngle_ = function(lidAngle) {
* Called externally after a drag.
*/
Blockly.Trashcan.prototype.close = function() {
this.setOpen_(false);
this.setOpen(false);
};
/**
@@ -440,7 +440,7 @@ Blockly.Trashcan.prototype.click = function() {
*/
Blockly.Trashcan.prototype.mouseOver_ = function() {
if (this.contents_.length) {
this.setOpen_(true);
this.setOpen(true);
}
};
@@ -451,8 +451,8 @@ Blockly.Trashcan.prototype.mouseOver_ = function() {
*/
Blockly.Trashcan.prototype.mouseOut_ = function() {
// No need to do a .hasBlocks check here because if it doesn't the trashcan
// wont be open in the first place, and setOpen_ won't run.
this.setOpen_(false);
// won't be open in the first place, and setOpen won't run.
this.setOpen(false);
};
/**

View File

@@ -361,7 +361,7 @@ Blockly.WorkspaceSvg.prototype.lastRecordedPageScroll_ = null;
/**
* Map from function names to callbacks, for deciding what to do when a button
* is clicked.
* @type {!Object.<string, function(!Blockly.FlyoutButton)>}
* @type {!Object.<string, ?function(!Blockly.FlyoutButton)>}
* @private
*/
Blockly.WorkspaceSvg.prototype.flyoutButtonCallbacks_ = {};
@@ -369,7 +369,7 @@ Blockly.WorkspaceSvg.prototype.flyoutButtonCallbacks_ = {};
/**
* Map from function names to callbacks, for deciding what to do when a custom
* toolbox category is opened.
* @type {!Object.<string, function(!Blockly.Workspace):!Array.<!Element>>}
* @type {!Object.<string, ?function(!Blockly.Workspace):!Array.<!Element>>}
* @private
*/
Blockly.WorkspaceSvg.prototype.toolboxCategoryCallbacks_ = {};