Skip to content

Commit d3c8a1b

Browse files
committed
fix(back button): do not animate back button transition if the title doesn't change. Fixes #1858
1 parent 69442d5 commit d3c8a1b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: js/angular/controller/navBarController.js

+8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ function($scope, $element, $attrs, $ionicViewService, $animate, $compile, $ionic
1616

1717
$scope.$on('$destroy', deregisterInstance);
1818

19+
$scope.$on('$viewHistory.historyChange', function(e, data) {
20+
backIsShown = !!data.showBack;
21+
});
22+
1923
var self = this;
2024

2125
this.leftButtonsElement = jqLite(
@@ -60,6 +64,10 @@ function($scope, $element, $attrs, $ionicViewService, $animate, $compile, $ionic
6064

6165
this.changeTitle = function(title, direction) {
6266
if ($scope.title === title) {
67+
// if we're not animating the title, but the back button becomes invisible
68+
if(typeof backIsShown != 'undefined' && !backIsShown && $scope.backButtonShown){
69+
jqLite($element[0].querySelector('.back-button')).addClass('ng-hide');
70+
}
6371
return false;
6472
}
6573
this.setTitle(title);

0 commit comments

Comments
 (0)