fix(nav): remove incorrectly used removeStart as a starting index in for loop. Fixes #8442

This commit is contained in:
Max Lynch
2016-10-08 20:22:11 -05:00
parent 88da70c386
commit 6496c7a996
2 changed files with 17 additions and 3 deletions

View File

@ -237,7 +237,7 @@ export class NavControllerBase extends Ion implements NavController {
this._queue.push(ti); 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 // then this will kick off this transition
this._nextTrns(); this._nextTrns();
@ -287,8 +287,8 @@ export class NavControllerBase extends Ion implements NavController {
leavingRequiresTransition = (ti.removeStart + ti.removeCount === viewsLength); leavingRequiresTransition = (ti.removeStart + ti.removeCount === viewsLength);
for (var i = ti.removeStart; i <= ti.removeCount; i++) { for (var i = 0; i < ti.removeCount; i++) {
destroyQueue.push(this._views[i]); destroyQueue.push(this._views[i + ti.removeStart]);
} }
for (var i = viewsLength - 1; i >= 0; i--) { for (var i = viewsLength - 1; i >= 0; i--) {
@ -914,6 +914,13 @@ export class NavControllerBase extends Ion implements NavController {
return this._views.length; return this._views.length;
} }
/**
* Return the stack of views in this NavController.
*/
getViews(): Array<ViewController> {
return this._views;
}
isSwipeBackEnabled(): boolean { isSwipeBackEnabled(): boolean {
return this._sbEnabled; return this._sbEnabled;
} }

View File

@ -486,6 +486,13 @@ export abstract class NavController {
*/ */
abstract length(): number; 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. * Returns the active child navigation.
*/ */