Skip to content

Commit

Permalink
fix(nav): remove incorrectly used removeStart as a starting index in …
Browse files Browse the repository at this point in the history
…for loop. Fixes #8442
  • Loading branch information
mlynch committed Oct 9, 2016
1 parent 88da70c commit 6496c7a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/navigation/nav-controller-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class NavControllerBase extends Ion implements NavController {

this._queue.push(ti);

// if there isn't a transitoin already happening
// if there isn't a transition already happening
// then this will kick off this transition
this._nextTrns();

Expand Down Expand Up @@ -287,8 +287,8 @@ export class NavControllerBase extends Ion implements NavController {

leavingRequiresTransition = (ti.removeStart + ti.removeCount === viewsLength);

for (var i = ti.removeStart; i <= ti.removeCount; i++) {
destroyQueue.push(this._views[i]);
for (var i = 0; i < ti.removeCount; i++) {
destroyQueue.push(this._views[i + ti.removeStart]);
}

for (var i = viewsLength - 1; i >= 0; i--) {
Expand Down Expand Up @@ -914,6 +914,13 @@ export class NavControllerBase extends Ion implements NavController {
return this._views.length;
}

/**
* Return the stack of views in this NavController.
*/
getViews(): Array<ViewController> {
return this._views;
}

isSwipeBackEnabled(): boolean {
return this._sbEnabled;
}
Expand Down
7 changes: 7 additions & 0 deletions src/navigation/nav-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,13 @@ export abstract class NavController {
*/
abstract length(): number;


/**
* Returns the current stack of views in this nav controller.
* @returns {Array<ViewController>} the stack of view controllers in this nav controller.
*/
abstract getViews(): Array<ViewController>;

/**
* Returns the active child navigation.
*/
Expand Down

0 comments on commit 6496c7a

Please sign in to comment.