Skip to content

Commit

Permalink
Relay and Delay blocks now show orphaned error
Browse files Browse the repository at this point in the history
  • Loading branch information
TechplexEngineer committed Jun 24, 2014
1 parent de89088 commit d66c4d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/robotbuilder/blocks/local/relay.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Blockly.Blocks['declare_relay'] = {
this.setPreviousStatement(true, 'declare');
this.setNextStatement(true, 'declare');
},
onchange: EasyJ.Checker.EnsureNotTop_Init,
renameVar: function(oldName, newName) {
if (Blockly.Names.equals(oldName, this.getFieldValue('NAME'))) {
this.setFieldValue(newName, 'NAME');
Expand Down
9 changes: 9 additions & 0 deletions apps/robotbuilder/blocks/local/timing.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ Blockly.Blocks['delay'] = {
this.setInputsInline(true);
this.setPreviousStatement(true, 'statement');
this.setNextStatement(true, 'statement');
},
onchange: function(evt) {
if (!this.workspace || this.isInFlyout) {
// Block has been deleted, or is in flyout
return;
}
var block = this;
this.setWarningText(EasyJ.Checker.PickWarning(block, [EasyJ.Checker.EnsureNotOrphaned]));

}
};
Blockly.Java['delay'] = function(block) {
Expand Down

0 comments on commit d66c4d2

Please sign in to comment.