1
0
mirror of https://github.com/flarum/core.git synced 2025-07-25 18:51:40 +02:00

Ability to merge list items

This commit is contained in:
Toby Zerner
2015-05-02 08:28:02 +09:30
parent bdf71abf23
commit 74c145eb03

View File

@@ -10,6 +10,14 @@ export default class ItemList {
this[key] = new Item(content, position); 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() { toArray() {
var items = []; var items = [];
for (var i in this) { for (var i in this) {