|
3 | 3 |
|
4 | 4 | /**
|
5 | 5 | * @description
|
6 |
| - * The NavController is a navigation stack View Controller modelled off of |
| 6 | + * The NavController is a navigation stack View Controller modelled off of |
7 | 7 | * UINavigationController from Cocoa Touch. With the Nav Controller, you can
|
8 | 8 | * "push" new "pages" on to the navigation stack, and then pop them off to go
|
9 | 9 | * back. The NavController controls a navigation bar with a back button and title
|
|
17 | 17 | *
|
18 | 18 | */
|
19 | 19 |
|
20 |
| -angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gesture']) |
| 20 | +angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gesture']) |
21 | 21 |
|
22 | 22 | /**
|
23 | 23 | * Our Nav Bar directive which updates as the controller state changes.
|
24 | 24 | */
|
25 |
| -.directive('navBar', ['$ionicViewService', '$rootScope', '$animate', '$compile', |
| 25 | +.directive('navBar', ['$ionicViewService', '$rootScope', '$animate', '$compile', |
26 | 26 | function( $ionicViewService, $rootScope, $animate, $compile) {
|
27 | 27 |
|
28 | 28 | /**
|
@@ -67,14 +67,14 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
|
67 | 67 | backButtonIcon: '@',
|
68 | 68 | alignTitle: '@'
|
69 | 69 | },
|
70 |
| - template: '<header class="bar bar-header nav-bar invisible">' + |
| 70 | + template: '<header class="bar bar-header nav-bar invisible">' + |
71 | 71 | '<div class="buttons"> ' +
|
72 | 72 | '<button view-back class="button" ng-if="enableBackButton"></button>' +
|
73 |
| - '<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button no-animation {{button.type}}" ng-bind-html="button.content"></button>' + |
| 73 | + '<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button no-animation {{button.type}}" ng-bind-html="button.content"></button>' + |
74 | 74 | '</div>' +
|
75 |
| - '<h1 class="title" ng-bind-html="currentTitle"></h1>' + |
| 75 | + '<h1 class="title" ng-bind-html="currentTitle"></h1>' + |
76 | 76 | '<div class="buttons" ng-if="rightButtons.length"> ' +
|
77 |
| - '<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button no-animation {{button.type}}" ng-bind-html="button.content"></button>' + |
| 77 | + '<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button no-animation {{button.type}}" ng-bind-html="button.content"></button>' + |
78 | 78 | '</div>' +
|
79 | 79 | '</header>',
|
80 | 80 |
|
@@ -162,7 +162,7 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
|
162 | 162 | }])
|
163 | 163 |
|
164 | 164 |
|
165 |
| -.directive('view', ['$ionicViewService', '$rootScope', '$animate', |
| 165 | +.directive('view', ['$ionicViewService', '$rootScope', '$animate', |
166 | 166 | function( $ionicViewService, $rootScope, $animate) {
|
167 | 167 | return {
|
168 | 168 | restrict: 'EA',
|
@@ -267,10 +267,10 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
|
267 | 267 | }])
|
268 | 268 |
|
269 | 269 |
|
270 |
| -.directive('navView', ['$ionicViewService', '$state', '$compile', '$controller', |
271 |
| - function( $ionicViewService, $state, $compile, $controller) { |
| 270 | +.directive('navView', ['$ionicViewService', '$state', '$compile', '$controller', '$animate', |
| 271 | + function( $ionicViewService, $state, $compile, $controller, $animate) { |
272 | 272 | // IONIC's fork of Angular UI Router, v0.2.7
|
273 |
| - // the navView handles registering views in the history, which animation to use, and which |
| 273 | + // the navView handles registering views in the history, which animation to use, and which |
274 | 274 | var viewIsUpdating = false;
|
275 | 275 |
|
276 | 276 | var directive = {
|
@@ -313,6 +313,11 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
|
313 | 313 | updateView(false);
|
314 | 314 |
|
315 | 315 | function updateView(doAnimate) {
|
| 316 | + //===false because $animate.enabled() is a noop without angular-animate included |
| 317 | + if ($animate.enabled() === false) { |
| 318 | + doAnimate = false; |
| 319 | + } |
| 320 | + |
316 | 321 | var locals = $state.$current && $state.$current.locals[name];
|
317 | 322 | if (locals === viewLocals) return; // nothing to do
|
318 | 323 | var renderer = $ionicViewService.getRenderer(element, attr, scope);
|
|
0 commit comments