@@ -136,7 +136,10 @@ export class NavControllerBase extends Ion implements NavController {
136
136
}
137
137
138
138
removeView ( viewController : ViewController , opts ?: NavOptions , done ?: Function ) : Promise < any > {
139
- return this . remove ( this . indexOf ( viewController ) , 1 , opts , done ) ;
139
+ return this . _queueTrns ( {
140
+ removeView : viewController ,
141
+ opts : opts ,
142
+ } , done ) ;
140
143
}
141
144
142
145
setRoot ( pageOrViewCtrl : any , params ?: any , opts ?: NavOptions , done ?: Function ) : Promise < any > {
@@ -291,7 +294,17 @@ export class NavControllerBase extends Ion implements NavController {
291
294
}
292
295
const viewsLength = this . _views . length ;
293
296
294
- if ( isPresent ( ti . removeStart ) ) {
297
+ if ( isPresent ( ti . removeView ) ) {
298
+ assert ( ! isPresent ( ti . removeStart ) , 'removeView and removeIndex can not be enabled at the same time' ) ;
299
+ let index = this . _views . indexOf ( ti . removeView ) ;
300
+
301
+ if ( index >= 0 ) {
302
+ ti . removeStart = index ;
303
+ ti . removeCount = 1 ;
304
+ ti . leavingRequiresTransition = ( ( ti . removeStart + ti . removeCount ) === viewsLength ) ;
305
+ }
306
+
307
+ } else if ( isPresent ( ti . removeStart ) ) {
295
308
if ( ti . removeStart < 0 ) {
296
309
ti . removeStart = ( viewsLength - 1 ) ;
297
310
}
@@ -347,6 +360,7 @@ export class NavControllerBase extends Ion implements NavController {
347
360
if ( isPresent ( removeStart ) ) {
348
361
assert ( removeStart >= 0 , 'removeStart can not be negative' ) ;
349
362
assert ( ti . removeCount >= 0 , 'removeCount can not be negative' ) ;
363
+
350
364
destroyQueue = [ ] ;
351
365
for ( i = 0 ; i < ti . removeCount ; i ++ ) {
352
366
view = this . _views [ i + removeStart ] ;
@@ -580,6 +594,8 @@ export class NavControllerBase extends Ion implements NavController {
580
594
}
581
595
582
596
_trnsStart ( transition : Transition , enteringView : ViewController , leavingView : ViewController , opts : NavOptions , resolve : TransitionResolveFn ) {
597
+ assert ( this . isTransitioning ( ) , 'isTransitioning() has to be true' ) ;
598
+
583
599
this . _trnsId = null ;
584
600
585
601
// set the correct zIndex for the entering and leaving views
@@ -624,9 +640,6 @@ export class NavControllerBase extends Ion implements NavController {
624
640
// get the set duration of this transition
625
641
const duration = transition . getDuration ( ) ;
626
642
627
- // set that this nav is actively transitioning
628
- this . setTransitioning ( true ) ;
629
-
630
643
if ( transition . isRoot ( ) ) {
631
644
// this is the top most, or only active transition, so disable the app
632
645
// add XXms to the duration the app is disabled when the keyboard is open
0 commit comments