mirror of
https://github.com/google/blockly.git
synced 2026-06-17 00:25:14 +02:00
Adds a getter for the draggers on gesture (#4844)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user