diff --git a/js/angular/controller/navBarController.js b/js/angular/controller/navBarController.js index a08f566f93..c5cfc61012 100644 --- a/js/angular/controller/navBarController.js +++ b/js/angular/controller/navBarController.js @@ -16,6 +16,10 @@ function($scope, $element, $attrs, $ionicViewService, $animate, $compile, $ionic $scope.$on('$destroy', deregisterInstance); + $scope.$on('$viewHistory.historyChange', function(e, data) { + backIsShown = !!data.showBack; + }); + var self = this; this.leftButtonsElement = jqLite( @@ -60,6 +64,10 @@ function($scope, $element, $attrs, $ionicViewService, $animate, $compile, $ionic this.changeTitle = function(title, direction) { if ($scope.title === title) { + // if we're not animating the title, but the back button becomes invisible + if(typeof backIsShown != 'undefined' && !backIsShown && $scope.backButtonShown){ + jqLite($element[0].querySelector('.back-button')).addClass('ng-hide'); + } return false; } this.setTitle(title);