@@ -384,38 +384,34 @@ export class Tabs extends Ion implements AfterViewInit {
384
384
// it's possible the tab is only for opening modal's or signing out
385
385
// and doesn't actually have content. In the case there's no content
386
386
// for a tab then do nothing and leave the current view as is
387
- if ( ! selectedTab . root ) {
388
- selectedTab . ionSelect . emit ( selectedTab ) ;
389
- this . ionChange . emit ( selectedTab ) ;
390
- return ;
391
- }
392
-
393
- // At this point we are going to perform a page switch
394
- // Let's fire willLeave in the current tab page
395
- let currentPage : ViewController ;
396
- if ( currentTab ) {
397
- currentPage = currentTab . getActive ( ) ;
398
- currentPage && currentPage . _willLeave ( false ) ;
399
- }
387
+ if ( selectedTab . root ) {
388
+ // At this point we are going to perform a page switch
389
+ // Let's fire willLeave in the current tab page
390
+ var currentPage : ViewController ;
391
+ if ( currentTab ) {
392
+ currentPage = currentTab . getActive ( ) ;
393
+ currentPage && currentPage . _willLeave ( false ) ;
394
+ }
400
395
401
- // Fire willEnter in the new selected tab
402
- const selectedPage = selectedTab . getActive ( ) ;
403
- selectedPage && selectedPage . _willEnter ( ) ;
396
+ // Fire willEnter in the new selected tab
397
+ const selectedPage = selectedTab . getActive ( ) ;
398
+ selectedPage && selectedPage . _willEnter ( ) ;
404
399
405
- // Let's start the transition
406
- opts . animate = false ;
407
- selectedTab . load ( opts , ( ) => {
408
- if ( opts . updateUrl !== false ) {
409
- this . _linker . navChange ( DIRECTION_SWITCH ) ;
410
- }
411
- this . _tabSwitchEnd ( selectedTab , selectedPage , currentPage ) ;
412
- } ) ;
413
- }
400
+ // Let's start the transition
401
+ opts . animate = false ;
402
+ selectedTab . load ( opts , ( ) => {
403
+ if ( opts . updateUrl !== false ) {
404
+ this . _linker . navChange ( DIRECTION_SWITCH ) ;
405
+ }
406
+ this . _tabSwitchEnd ( selectedTab , selectedPage , currentPage ) ;
407
+ } ) ;
408
+ }
414
409
415
- _tabSwitchEnd ( selectedTab : Tab , selectedPage : ViewController , currentPage : ViewController ) {
416
410
selectedTab . ionSelect . emit ( selectedTab ) ;
417
411
this . ionChange . emit ( selectedTab ) ;
412
+ }
418
413
414
+ _tabSwitchEnd ( selectedTab : Tab , selectedPage : ViewController , currentPage : ViewController ) {
419
415
// Update tabs selection state
420
416
const tabs = this . _tabs ;
421
417
let tab : Tab ;
0 commit comments