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);
}
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) {