mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
* Fix #1487 and only add the delete cursor if the block is not deletable. Also add a grab cursor when it is not deletable so the cursor keeps the grab hand when over the toolbox. This changes the toolbox api slightly, but the methods it touches are @package so it should be okay.
This commit is contained in:
@@ -168,7 +168,9 @@ Blockly.BlockDragger.prototype.startBlockDrag = function(currentDragDeltaXY) {
|
||||
this.draggingBlock_.moveToDragSurface_();
|
||||
|
||||
if (this.workspace_.toolbox_) {
|
||||
this.workspace_.toolbox_.addDeleteStyle();
|
||||
var style = this.draggingBlock_.isDeletable() ? 'blocklyToolboxDelete' :
|
||||
'blocklyToolboxGrab';
|
||||
this.workspace_.toolbox_.addStyle(style);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -224,7 +226,9 @@ Blockly.BlockDragger.prototype.endBlockDrag = function(e, currentDragDeltaXY) {
|
||||
this.workspace_.setResizesEnabled(true);
|
||||
|
||||
if (this.workspace_.toolbox_) {
|
||||
this.workspace_.toolbox_.removeDeleteStyle();
|
||||
var style = this.draggingBlock_.isDeletable() ? 'blocklyToolboxDelete' :
|
||||
'blocklyToolboxGrab';
|
||||
this.workspace_.toolbox_.removeStyle(style);
|
||||
}
|
||||
Blockly.Events.setGroup(false);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user