2
0
mirror of https://github.com/esiur/esiur-js.git synced 2026-04-04 05:58:22 +00:00
This commit is contained in:
2022-02-17 18:06:02 +03:00
parent 8eb67ae4fb
commit 214785a893
27 changed files with 1645 additions and 396 deletions

View File

@@ -45,7 +45,7 @@ export default class AutoList extends IEventHandler
add(value)
{
if (value instanceof IDestructible)
value.on("destroy", this._item_destroyed, this);
value.on("destroy", this.#_item_destroyed, this);
this.list.push(value);
@@ -58,10 +58,10 @@ export default class AutoList extends IEventHandler
return;
if (value instanceof IDestructible)
value.on("destroy", this._item_destroyed, this);
value.on("destroy", this.#_item_destroyed, this);
if (this.list[index] instanceof IDestructible)
this.list[index].off("destroy", this._item_destroyed);
this.list[index].off("destroy", this.#_item_destroyed);
this.list[index] = value;
}
@@ -99,14 +99,14 @@ export default class AutoList extends IEventHandler
var item = this.list[index];
if (item instanceof IDestructible)
item.off("destroy", this._item_destroyed);
item.off("destroy", this.#_item_destroyed);
this.list.splice(index, 1);
this._emit("remove", item);
}
_item_destroyed(sender)
#_item_destroyed = function(sender)
{
this.remove(sender);
}