mirror of
https://github.com/google/blockly.git
synced 2026-01-20 07:17:10 +01:00
Don't insert disabled blocks from the flyout. (#3046)
* Don't insert disabled blocks from the flyout.
This commit is contained in:
@@ -302,8 +302,13 @@ Blockly.navigation.insertFromFlyout = function() {
|
||||
return;
|
||||
}
|
||||
|
||||
var newBlock = flyout.createBlock(
|
||||
Blockly.navigation.getFlyoutCursor_().getCurNode().getLocation());
|
||||
var curBlock = Blockly.navigation.getFlyoutCursor_().getCurNode().getLocation();
|
||||
if (!curBlock.isEnabled()) {
|
||||
Blockly.navigation.warn_('Can\'t insert a disabled block.');
|
||||
return;
|
||||
}
|
||||
|
||||
var newBlock = flyout.createBlock(curBlock);
|
||||
// Render to get the sizing right.
|
||||
newBlock.render();
|
||||
// Connections are hidden when the block is first created. Normally there's
|
||||
|
||||
Reference in New Issue
Block a user