diff --git a/core/gesture.js b/core/gesture.js index 8c22c423b..48e5c46a1 100644 --- a/core/gesture.js +++ b/core/gesture.js @@ -968,6 +968,23 @@ Blockly.Gesture.prototype.getInsertionMarkers = function() { return []; }; +/** + * Gets the current dragger if an item is being dragged. Null if nothing is + * being dragged. + * @return {!Blockly.WorkspaceDragger|!Blockly.BubbleDragger|!Blockly.IBlockDragger|null} + * The dragger that is currently in use or null if no drag is in progress. + */ +Blockly.Gesture.prototype.getCurrentDragger = function() { + if (this.isDraggingBlock_) { + return this.blockDragger_; + } else if (this.isDraggingWorkspace_) { + return this.workspaceDragger_; + } else if (this.isDraggingBubble_) { + return this.bubbleDragger_; + } + return null; +}; + /** * Is a drag or other gesture currently in progress on any workspace? * @return {boolean} True if gesture is occurring.