|
|
@@ -268,11 +268,13 @@ |
|
|
this._error(this._logf('dom-repeat', 'expected array for `items`,' +
|
|
|
' found', this.items));
|
|
|
}
|
|
|
- this._splices = [];
|
|
|
+ this._keySplices = [];
|
|
|
+ this._indexSplices = [];
|
|
|
this._needFullRefresh = true;
|
|
|
this._debounceTemplate(this._render);
|
|
|
} else if (change.path == 'items.splices') {
|
|
|
- this._splices = this._splices.concat(change.value.keySplices);
|
|
|
+ this._keySplices = this._keySplices.concat(change.value.keySplices);
|
|
|
+ this._indexSplices = this._indexSplices.concat(change.value.indexSplices);
|
|
|
this._debounceTemplate(this._render);
|
|
|
} else { // items.*
|
|
|
// slice off 'items.' ('items.'.length == 6)
|
|
|
@@ -303,10 +305,10 @@ |
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * Forces the element to render its content. Normally rendering is
|
|
|
- * asynchronous to a provoking change. This is done for efficiency so
|
|
|
- * that multiple changes trigger only a single render. The render method
|
|
|
- * should be called if, for example, template rendering is required to
|
|
|
+ * Forces the element to render its content. Normally rendering is
|
|
|
+ * asynchronous to a provoking change. This is done for efficiency so
|
|
|
+ * that multiple changes trigger only a single render. The render method
|
|
|
+ * should be called if, for example, template rendering is required to
|
|
|
* validate application state.
|
|
|
*/
|
|
|
render: function() {
|
|
|
@@ -324,17 +326,18 @@ |
|
|
this._needFullRefresh = false;
|
|
|
} else {
|
|
|
if (this._sortFn) {
|
|
|
- this._applySplicesUserSort(this._splices);
|
|
|
+ this._applySplicesUserSort(this._keySplices);
|
|
|
} else {
|
|
|
if (this._filterFn) {
|
|
|
// TODK(kschaaf): Filtering using array sort takes slow path
|
|
|
this._applyFullRefresh();
|
|
|
} else {
|
|
|
- this._applySplicesArrayOrder(this._splices);
|
|
|
+ this._applySplicesArrayOrder(this._indexSplices);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- this._splices = [];
|
|
|
+ this._keySplices = [];
|
|
|
+ this._indexSplices = [];
|
|
|
// Update final _keyToInstIdx and instance indices
|
|
|
var keyToIdx = this._keyToInstIdx = {};
|
|
|
for (var i=0; i<this._instances.length; i++) {
|
|
|
@@ -511,10 +514,10 @@ |
|
|
}
|
|
|
this._instances.splice(s.index, s.removed.length);
|
|
|
// Insert placeholders for new rows
|
|
|
- for (var i=0; i<s.added.length; i++) {
|
|
|
+ for (var i=0; i<s.addedKeys.length; i++) {
|
|
|
var inst = {
|
|
|
isPlaceholder: true,
|
|
|
- key: s.added[i]
|
|
|
+ key: s.addedKeys[i]
|
|
|
};
|
|
|
this._instances.splice(s.index + i, 0, inst);
|
|
|
}
|
|
|
|
0 comments on commit
f74d072