Fix mutators not removing empty input
@@ -41,9 +41,15 @@ Blockly.domToMutation = function(container) {
}
}
+ if (this.itemCount_ == 0) {
+ if (this.emptyInputName != null) {
+ this.removeInput(this.emptyInputName);
+ }
+ } else {
for (var x = 0; x < this.itemCount_; x++) {
this.removeInput(this.repeatingInputName + x);
}
+ }
this.itemCount_ = window.parseInt(container.getAttribute('items'), 10);
for (var x = 0; x < this.itemCount_; x++) {
this.addInput(x);
