1- var ngMajorVer = angular . version . major ;
2- var ngMinorVer = angular . version . minor ;
31/**
42 * @ngdoc directive
53 * @name ui.router.state.directive:ui-view
@@ -24,9 +22,6 @@ var ngMinorVer = angular.version.minor;
2422 * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you
2523 * scroll ui-view elements into view when they are populated during a state activation.
2624 *
27- * @param {string= } noanimation If truthy, the non-animated renderer will be selected (no animations
28- * will be applied to the ui-view)
29- *
3025 * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)
3126 * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*
3227 *
@@ -138,35 +133,24 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate)
138133 // Returns a set of DOM manipulation functions based on which Angular version
139134 // it should use
140135 function getRenderer ( attrs , scope ) {
141- var statics = {
142- enter : function ( element , target , cb ) { target . after ( element ) ; cb ( ) ; } ,
143- leave : function ( element , cb ) { element . remove ( ) ; cb ( ) ; }
136+ var statics = function ( ) {
137+ return {
138+ enter : function ( element , target , cb ) { target . after ( element ) ; cb ( ) ; } ,
139+ leave : function ( element , cb ) { element . remove ( ) ; cb ( ) ; }
140+ } ;
144141 } ;
145142
146- if ( ! ! attrs . noanimation ) return statics ;
147-
148- function animEnabled ( element ) {
149- if ( ngMajorVer === 1 && ngMinorVer >= 4 ) return ! ! $animate . enabled ( element ) ;
150- if ( ngMajorVer === 1 && ngMinorVer >= 2 ) return ! ! $animate . enabled ( ) ;
151- return ( ! ! $animator ) ;
152- }
153-
154- // ng 1.2+
155143 if ( $animate ) {
156144 return {
157145 enter : function ( element , target , cb ) {
158- if ( ! animEnabled ( element ) ) {
159- statics . enter ( element , target , cb ) ;
160- } else if ( angular . version . minor > 2 ) {
146+ if ( angular . version . minor > 2 ) {
161147 $animate . enter ( element , null , target ) . then ( cb ) ;
162148 } else {
163149 $animate . enter ( element , null , target , cb ) ;
164150 }
165151 } ,
166152 leave : function ( element , cb ) {
167- if ( ! animEnabled ( element ) ) {
168- statics . leave ( element , cb ) ;
169- } else if ( angular . version . minor > 2 ) {
153+ if ( angular . version . minor > 2 ) {
170154 $animate . leave ( element ) . then ( cb ) ;
171155 } else {
172156 $animate . leave ( element , cb ) ;
@@ -175,7 +159,6 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate)
175159 } ;
176160 }
177161
178- // ng 1.1.5
179162 if ( $animator ) {
180163 var animate = $animator && $animator ( scope , attrs ) ;
181164
@@ -185,7 +168,7 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate)
185168 } ;
186169 }
187170
188- return statics ;
171+ return statics ( ) ;
189172 }
190173
191174 var directive = {
0 commit comments