app/assets/htmls/gs-element-blockly.html in gobstones-blockly-0.32.0 vs app/assets/htmls/gs-element-blockly.html in gobstones-blockly-0.32.1
- old
+ new
@@ -5201,29 +5201,25 @@
this._addOtherwise();
triggerRefresh(this);
},
_removeElement: function(n) {
- const isLastBranch = this.length === 2;
-
- const elements = ["newline", "label1", "element", "label2", "condition"];
+ const elements = ["label1", "element", "label2", "condition", "newline"];
elements.forEach((element) => this.removeInput(element + n));
this.length--;
let id;
elements.forEach((element) => {
id = 1;
for (let input of this.inputList) {
if (input.name.startsWith(element)) {
- input.name = element + id;
+ input.name = element + (id + (element === "newline" ? 1 : 0));
id++;
}
}
});
- if (isLastBranch) this.removeInput("newline1");
-
triggerRefresh(this);
},
_addAddButton: function() {
const icon = "plus.png";
@@ -5274,10 +5270,10 @@
getLocalMediaUrl(this, icon),
getLocalMediaSize(icon),
getLocalMediaSize(icon),
"",
function() {
- this._removeElement(n);
+ this._removeElement(parseInt(input.name.replace(/\D/g,'')));
}.bind(this)
);
setTimeout(() => { removeButton.setTooltip("Quitar opciĆ³n"); });
input.appendField(removeButton);
}
\ No newline at end of file