Skip to content

Commit 82958d4

Browse files
committed
Minor tweaks to comments, internal API consistency.
1 parent 4a45d4f commit 82958d4

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎src/lib/template/dom-repeat.html‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,13 @@
328328
}
329329
}
330330
this._splices = [];
331-
// Update final _keyToInstIdx and inst indices
331+
// Update final _keyToInstIdx and instance indices
332332
var keyToIdx = this._keyToInstIdx = {};
333333
var keys = this._keys;
334334
for (var i=0; i<keys.length; i++) {
335335
var key = keys[i];
336-
var inst = this._instances[i];
337336
keyToIdx[key] = i;
337+
var inst = this._instances[i];
338338
inst.__setProperty(this.indexAs, i, true);
339339
}
340340
this.fire('dom-change');
@@ -343,11 +343,11 @@
343343
// Render method 1: full refesh
344344
// ----
345345
// Full list of keys is pulled from the collection, then sorted, filtered,
346-
// and interated to create (or reuse) existing instances
346+
// and iterated to create (or reuse) existing instances
347347
_applyFullRefresh: function() {
348348
var c = this.collection;
349-
// Start with unordered keys for view sort,
350-
// or get them in array order for array sort
349+
// Start with unordered keys for user sort,
350+
// or get them in array order for array order
351351
if (this._sortFn) {
352352
this._keys = c ? c.getKeys() : [];
353353
} else {
@@ -377,7 +377,7 @@
377377
var key = keys[i];
378378
var inst = this._instances[i];
379379
if (!inst) {
380-
this._instances.push(this._insertRow(i, null, key));
380+
this._instances.push(this._insertRow(i, key));
381381
} else {
382382
inst.__setProperty('__key__', key, true);
383383
inst.__setProperty(this.as, c.getItem(key), true);
@@ -430,7 +430,7 @@
430430
// Remove & pool removed instances
431431
if (removedIdxs.length) {
432432
// Sort removed instances idx's then remove backwards,
433-
// so we don't invalidate inst index
433+
// so we don't invalidate instance index
434434
removedIdxs.sort();
435435
for (var i=removedIdxs.length-1; i>=0 ; i--) {
436436
var idx = removedIdxs[i];
@@ -487,7 +487,7 @@
487487
}
488488
// Insert key & inst at insertion point
489489
this._keys.splice(idx, 0, key);
490-
this._instances.splice(idx, 0, this._insertRow(idx, pool, key));
490+
this._instances.splice(idx, 0, this._insertRow(idx, key, pool));
491491
return idx;
492492
},
493493

@@ -527,7 +527,7 @@
527527
// Replace placeholders with actual instances (from pool or newly created)
528528
this._instances.forEach(function(inst, idx) {
529529
if (inst.isPlaceholder) {
530-
this._instances[idx] = this._insertRow(idx, pool, inst.key);
530+
this._instances[idx] = this._insertRow(idx, inst.key, pool);
531531
}
532532
}, this);
533533
},
@@ -544,7 +544,7 @@
544544
return inst;
545545
},
546546

547-
_insertRow: function(idx, pool, key) {
547+
_insertRow: function(idx, key, pool) {
548548
var inst;
549549
if (inst = pool && pool.pop()) {
550550
inst.__setProperty(this.as, this.collection.getItem(key), true);

0 commit comments

Comments
 (0)