Skip to content

Commit

Permalink
fix(back button): do not animate back button transition if the title …
Browse files Browse the repository at this point in the history
…doesn't change. Fixes #1858
  • Loading branch information
perrygovier committed Sep 5, 2014
1 parent 69442d5 commit d3c8a1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/angular/controller/navBarController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d3c8a1b

Please sign in to comment.