Skip to content

Commit d66c4d2

Browse files
Relay and Delay blocks now show orphaned error
1 parent de89088 commit d66c4d2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

apps/robotbuilder/blocks/local/relay.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Blockly.Blocks['declare_relay'] = {
1616
this.setPreviousStatement(true, 'declare');
1717
this.setNextStatement(true, 'declare');
1818
},
19+
onchange: EasyJ.Checker.EnsureNotTop_Init,
1920
renameVar: function(oldName, newName) {
2021
if (Blockly.Names.equals(oldName, this.getFieldValue('NAME'))) {
2122
this.setFieldValue(newName, 'NAME');

apps/robotbuilder/blocks/local/timing.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ Blockly.Blocks['delay'] = {
1313
this.setInputsInline(true);
1414
this.setPreviousStatement(true, 'statement');
1515
this.setNextStatement(true, 'statement');
16+
},
17+
onchange: function(evt) {
18+
if (!this.workspace || this.isInFlyout) {
19+
// Block has been deleted, or is in flyout
20+
return;
21+
}
22+
var block = this;
23+
this.setWarningText(EasyJ.Checker.PickWarning(block, [EasyJ.Checker.EnsureNotOrphaned]));
24+
1625
}
1726
};
1827
Blockly.Java['delay'] = function(block) {

0 commit comments

Comments
 (0)