mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Fix ui event checks (#4512)
This commit is contained in:
@@ -293,7 +293,8 @@ Blockly.Procedures.updateMutatorFlyout_ = function(workspace) {
|
||||
* @package
|
||||
*/
|
||||
Blockly.Procedures.mutatorOpenListener = function(e) {
|
||||
if (!e.isUiEvent || e.element != 'mutatorOpen' || !e.newValue) {
|
||||
if (!(e.type == Blockly.Events.BUBBLE_OPEN && e.bubbleType === 'mutator' &&
|
||||
e.isOpen)) {
|
||||
return;
|
||||
}
|
||||
var workspaceId = /** @type {string} */ (e.workspaceId);
|
||||
|
||||
@@ -345,8 +345,8 @@ WorkspaceFactoryInit.addWorkspaceFactoryEventListeners_ = function(controller) {
|
||||
// Only enable "Edit Block" when a block is selected and it has a
|
||||
// surrounding parent, meaning it is nested in another block (blocks that
|
||||
// are not nested in parents cannot be shadow blocks).
|
||||
if (e.type == Blockly.Events.BLOCK_MOVE || (e.isUiEvent &&
|
||||
e.element == 'selected')) {
|
||||
if (e.type == Blockly.Events.BLOCK_MOVE ||
|
||||
e.type == Blockly.Event.SELECTED) {
|
||||
var selected = Blockly.selected;
|
||||
|
||||
// Show shadow button if a block is selected. Show "Add Shadow" if
|
||||
|
||||
Reference in New Issue
Block a user