mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(back button): do not animate back button transition if the title doesn't change. Fixes #1858
This commit is contained in:
8
js/angular/controller/navBarController.js
vendored
8
js/angular/controller/navBarController.js
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user