diff --git a/js/ext/angular/src/directive/ionicViewState.js b/js/ext/angular/src/directive/ionicViewState.js index cf595857e5..d789bd3324 100644 --- a/js/ext/angular/src/directive/ionicViewState.js +++ b/js/ext/angular/src/directive/ionicViewState.js @@ -126,12 +126,14 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu $scope.oldTitle = $scope.title; $scope.title = data && data.title || ''; - //If no animation, we're done! - if (!$scope.animateEnabled) { - hb.align(); - return; - } else { - animateTitles(); + // only change if they're different + if($scope.oldTitle !== $scope.title) { + if (!$scope.animateEnabled) { + //If no animation, we're done! + hb.align(); + } else { + animateTitles(); + } } } @@ -142,7 +144,7 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu //replace the first one with an oldTitle element currentTitles = $element[0].querySelectorAll('.title'); if (currentTitles.length) { - oldTitleEl = $compile('
')($scope); + oldTitleEl = $compile('')($scope); angular.element(currentTitles[0]).replaceWith(oldTitleEl); } //Compile new title