From 79c2fa6688f518fcb0285ec18929dc5a5471d0fd Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Thu, 3 Oct 2019 18:08:27 -0700 Subject: [PATCH] Make trashcan setOpen package and update a few annotations. --- core/block_dragger.js | 4 ++-- core/bubble_dragger.js | 4 ++-- core/trashcan.js | 14 +++++++------- core/workspace_svg.js | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/block_dragger.js b/core/block_dragger.js index 7b8f3232b..60a2db9f9 100644 --- a/core/block_dragger.js +++ b/core/block_dragger.js @@ -301,12 +301,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); } } }; diff --git a/core/bubble_dragger.js b/core/bubble_dragger.js index e19bb6169..65136e91c 100644 --- a/core/bubble_dragger.js +++ b/core/bubble_dragger.js @@ -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); } } }; diff --git a/core/trashcan.js b/core/trashcan.js index 7b5d676d5..24c845742 100644 --- a/core/trashcan.js +++ b/core/trashcan.js @@ -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); }; /** diff --git a/core/workspace_svg.js b/core/workspace_svg.js index fd0de41bb..8cc431587 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -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.} + * @type {!Object.} * @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.>} + * @type {!Object.>} * @private */ Blockly.WorkspaceSvg.prototype.toolboxCategoryCallbacks_ = {};