From 373b68d8b0c77a81afaebb5de9b4325cedeb1ebd Mon Sep 17 00:00:00 2001 From: Rodrigo Queiro Date: Tue, 19 Jul 2016 11:00:37 +0200 Subject: [PATCH] Add JSDoc for flyout drag state variables --- core/flyout.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/core/flyout.js b/core/flyout.js index 0d1fa0407..0484b53fc 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -99,8 +99,60 @@ Blockly.Flyout = function(workspaceOptions) { * @private */ this.permanentlyDisabled_ = []; + + /** + * y coordinate of mousedown - used to calculate scroll distances. + * @private {number} + */ + this.startDragMouseY_ = 0; + + /** + * x coordinate of mousedown - used to calculate scroll distances. + * @private {number} + */ + this.startDragMouseX_ = 0; }; +/** + * When a flyout drag is in progress, this is a reference to the flyout being + * dragged. This is used by Flyout.terminateDrag_ to reset dragMode_. + * @private {Blockly.Flyout} + */ +Blockly.Flyout.startFlyout_ = null; + +/** + * Event that started a drag. Used to determine the drag distance/direction and + * also passed to BlockSvg.onMouseDown_() after creating a new block. + * @private {Event} + */ +Blockly.Flyout.startDownEvent_ = null; + +/** + * Flyout block where the drag/click was initiated. Used to fire click events or + * create a new block. + * @private {Event} + */ +Blockly.Flyout.startBlock_ = null; + +/** + * Wrapper function called when a mouseup occurs during a background or block + * drag operation. + * @private {Array.} + */ +Blockly.Flyout.onMouseUpWrapper_ = null; + +/** + * Wrapper function called when a mousemove occurs during a background drag. + * @private {Array.} + */ +Blockly.Flyout.onMouseMoveWrapper_ = null; + +/** + * Wrapper function called when a mousemove occurs during a block drag. + * @private {Array.} + */ +Blockly.Flyout.onMouseMoveBlockWrapper_ = null; + /** * Does the flyout automatically close when a block is created? * @type {boolean} @@ -1122,10 +1174,6 @@ Blockly.Flyout.terminateDrag_ = function() { Blockly.unbindEvent_(Blockly.Flyout.onMouseMoveWrapper_); Blockly.Flyout.onMouseMoveWrapper_ = null; } - if (Blockly.Flyout.onMouseUpWrapper_) { - Blockly.unbindEvent_(Blockly.Flyout.onMouseUpWrapper_); - Blockly.Flyout.onMouseUpWrapper_ = null; - } Blockly.Flyout.startDownEvent_ = null; Blockly.Flyout.startBlock_ = null; Blockly.Flyout.startFlyout_ = null;