Skip to content

Commit 2703e7b

Browse files
authored
Blocks/control.js -- make 'forever' mutable [1/2]
1 parent 1b3c372 commit 2703e7b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

blocks_vertical/control.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ Blockly.Blocks['control_forever'] = {
6060
"category": Blockly.Categories.control,
6161
"extensions": ["colours_control", "shape_end"]
6262
});
63+
},
64+
mutationToDom: function() {
65+
var container = document.createElement('mutation');
66+
container.setAttribute('hasnext', this.nextConnection != null);
67+
return container;
68+
},
69+
domToMutation: function(xmlElement) {
70+
var hasNext = (xmlElement.getAttribute('hasnext') == 'true');
71+
this.setNextStatement(hasNext, "normal");
6372
}
6473
};
6574

0 commit comments

Comments
 (0)