Skip to content

Commit

Permalink
Update prev and next to use _lastKnownIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
cyk committed Nov 13, 2018
1 parent c91b261 commit effa93d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions addon/-private/collapse-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@ export class TableRowMeta extends EmberObject {
@computed('_tree.length')
get next() {
let tree = get(this, '_tree');
if (get(this, 'index') + 1 >= get(tree, 'length')) {
if (get(this, '_lastKnownIndex') + 1 >= get(tree, 'length')) {
return null;
}
return tree.objectAt(get(this, 'index') + 1);
return tree.objectAt(get(this, '_lastKnownIndex') + 1);
}

@computed('_tree.length')
get prev() {
if (get(this, 'index') === 0) {
if (get(this, '_lastKnownIndex') === 0) {
return null;
}
return get(this, '_tree').objectAt(get(this, 'index') - 1);
return get(this, '_tree').objectAt(get(this, '_lastKnownIndex') - 1);
}

toggleCollapse() {
Expand Down

0 comments on commit effa93d

Please sign in to comment.