kopia lustrzana https://github.com/backface/turtlestitch
support for deleting and inserting individual rings inside variadic inputs
rodzic
52aa087f9c
commit
89bf75a446
|
@ -16,6 +16,7 @@
|
|||
* blocks: refactored slot context menus
|
||||
* blocks: support for deleting and inserting individual script vars & ring params
|
||||
* German translation update
|
||||
* blocks: support for deleting and inserting individual rings inside variadic inputs
|
||||
|
||||
### 2022-01-25
|
||||
* blocks: support deleting and inserting individual variadic slots
|
||||
|
|
|
@ -7153,6 +7153,31 @@ RingMorph.prototype.fixBlockColor = function (nearest, isForced) {
|
|||
slot.fixLayout();
|
||||
};
|
||||
|
||||
// RingMorph menu
|
||||
|
||||
RingMorph.prototype.userMenu = function () {
|
||||
var menu = new MenuMorph(this);
|
||||
if (this.parent instanceof MultiArgMorph &&
|
||||
this.parentThatIsA(ScriptsMorph)) {
|
||||
if (!this.parent.maxInputs ||
|
||||
(this.parent.inputs().length < this.parent.maxInputs)) {
|
||||
menu.addItem(
|
||||
'insert a slot',
|
||||
() => this.parent.insertNewInputBefore(this)
|
||||
);
|
||||
}
|
||||
if (this.isEmptySlot() &&
|
||||
this.parent.inputs().length > this.parent.minInputs) {
|
||||
menu.addItem(
|
||||
'delete slot',
|
||||
() => this.parent.deleteSlot(this)
|
||||
);
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
return RingMorph.uber.userMenu.call(this);
|
||||
};
|
||||
|
||||
// ScriptsMorph ////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
|
|
Ładowanie…
Reference in New Issue