mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 16:02:44 +08:00
Ability to merge list items
This commit is contained in:
parent
bdf71abf23
commit
74c145eb03
|
@ -10,6 +10,14 @@ export default class ItemList {
|
|||
this[key] = new Item(content, position);
|
||||
}
|
||||
|
||||
merge(items) {
|
||||
for (var i in items) {
|
||||
if (items.hasOwnProperty(i) && items[i] instanceof Item) {
|
||||
this[i] = items[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
toArray() {
|
||||
var items = [];
|
||||
for (var i in this) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user