Adds a getter for the draggers on gesture (#4844)

This commit is contained in:
alschmiedt
2021-05-21 15:48:57 -07:00
committed by GitHub
parent ab70d6b1da
commit 50842fa85e
+17
View File
@@ -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.