Skip to content

Commit

Permalink
Minor tweaks to comments, internal API consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Jul 16, 2015
1 parent 4a45d4f commit 82958d4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/lib/template/dom-repeat.html
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@
}
}
this._splices = [];
// Update final _keyToInstIdx and inst indices
// Update final _keyToInstIdx and instance indices
var keyToIdx = this._keyToInstIdx = {};
var keys = this._keys;
for (var i=0; i<keys.length; i++) {
var key = keys[i];
var inst = this._instances[i];
keyToIdx[key] = i;
var inst = this._instances[i];
inst.__setProperty(this.indexAs, i, true);
}
this.fire('dom-change');
Expand All @@ -343,11 +343,11 @@
// Render method 1: full refesh
// ----
// Full list of keys is pulled from the collection, then sorted, filtered,
// and interated to create (or reuse) existing instances
// and iterated to create (or reuse) existing instances
_applyFullRefresh: function() {
var c = this.collection;
// Start with unordered keys for view sort,
// or get them in array order for array sort
// Start with unordered keys for user sort,
// or get them in array order for array order
if (this._sortFn) {
this._keys = c ? c.getKeys() : [];
} else {
Expand Down Expand Up @@ -377,7 +377,7 @@
var key = keys[i];
var inst = this._instances[i];
if (!inst) {
this._instances.push(this._insertRow(i, null, key));
this._instances.push(this._insertRow(i, key));
} else {
inst.__setProperty('__key__', key, true);
inst.__setProperty(this.as, c.getItem(key), true);
Expand Down Expand Up @@ -430,7 +430,7 @@
// Remove & pool removed instances
if (removedIdxs.length) {
// Sort removed instances idx's then remove backwards,
// so we don't invalidate inst index
// so we don't invalidate instance index
removedIdxs.sort();
for (var i=removedIdxs.length-1; i>=0 ; i--) {
var idx = removedIdxs[i];
Expand Down Expand Up @@ -487,7 +487,7 @@
}
// Insert key & inst at insertion point
this._keys.splice(idx, 0, key);
this._instances.splice(idx, 0, this._insertRow(idx, pool, key));
this._instances.splice(idx, 0, this._insertRow(idx, key, pool));
return idx;
},

Expand Down Expand Up @@ -527,7 +527,7 @@
// Replace placeholders with actual instances (from pool or newly created)
this._instances.forEach(function(inst, idx) {
if (inst.isPlaceholder) {
this._instances[idx] = this._insertRow(idx, pool, inst.key);
this._instances[idx] = this._insertRow(idx, inst.key, pool);
}
}, this);
},
Expand All @@ -544,7 +544,7 @@
return inst;
},

_insertRow: function(idx, pool, key) {
_insertRow: function(idx, key, pool) {
var inst;
if (inst = pool && pool.pop()) {
inst.__setProperty(this.as, this.collection.getItem(key), true);
Expand Down

0 comments on commit 82958d4

Please sign in to comment.