@@ -199,47 +199,45 @@ angular.module('ui.bootstrap.tabs', [])
199
199
controller : function ( ) {
200
200
//Empty controller so other directives can require being 'under' a tab
201
201
} ,
202
- compile : function ( elm , attrs , transclude ) {
203
- return function postLink ( scope , elm , attrs , tabsetCtrl ) {
204
- scope . $watch ( 'active' , function ( active ) {
205
- if ( active ) {
206
- tabsetCtrl . select ( scope ) ;
207
- }
208
- } ) ;
209
-
210
- scope . disabled = false ;
211
- if ( attrs . disable ) {
212
- scope . $parent . $watch ( $parse ( attrs . disable ) , function ( value ) {
213
- scope . disabled = ! ! value ;
214
- } ) ;
215
- }
216
-
217
- // Deprecation support of "disabled" parameter
218
- // fix(tab): IE9 disabled attr renders grey text on enabled tab #2677
219
- // This code is duplicated from the lines above to make it easy to remove once
220
- // the feature has been completely deprecated
221
- if ( attrs . disabled ) {
222
- $log . warn ( 'Use of "disabled" attribute has been deprecated, please use "disable"' ) ;
223
- scope . $parent . $watch ( $parse ( attrs . disabled ) , function ( value ) {
224
- scope . disabled = ! ! value ;
225
- } ) ;
202
+ link : function ( scope , elm , attrs , tabsetCtrl , transclude ) {
203
+ scope . $watch ( 'active' , function ( active ) {
204
+ if ( active ) {
205
+ tabsetCtrl . select ( scope ) ;
226
206
}
207
+ } ) ;
227
208
228
- scope . select = function ( ) {
229
- if ( ! scope . disabled ) {
230
- scope . active = true ;
231
- }
232
- } ;
209
+ scope . disabled = false ;
210
+ if ( attrs . disable ) {
211
+ scope . $parent . $watch ( $parse ( attrs . disable ) , function ( value ) {
212
+ scope . disabled = ! ! value ;
213
+ } ) ;
214
+ }
233
215
234
- tabsetCtrl . addTab ( scope ) ;
235
- scope . $on ( '$destroy' , function ( ) {
236
- tabsetCtrl . removeTab ( scope ) ;
216
+ // Deprecation support of "disabled" parameter
217
+ // fix(tab): IE9 disabled attr renders grey text on enabled tab #2677
218
+ // This code is duplicated from the lines above to make it easy to remove once
219
+ // the feature has been completely deprecated
220
+ if ( attrs . disabled ) {
221
+ $log . warn ( 'Use of "disabled" attribute has been deprecated, please use "disable"' ) ;
222
+ scope . $parent . $watch ( $parse ( attrs . disabled ) , function ( value ) {
223
+ scope . disabled = ! ! value ;
237
224
} ) ;
225
+ }
238
226
239
- //We need to transclude later, once the content container is ready.
240
- //when this link happens, we're inside a tab heading.
241
- scope . $transcludeFn = transclude ;
227
+ scope . select = function ( ) {
228
+ if ( ! scope . disabled ) {
229
+ scope . active = true ;
230
+ }
242
231
} ;
232
+
233
+ tabsetCtrl . addTab ( scope ) ;
234
+ scope . $on ( '$destroy' , function ( ) {
235
+ tabsetCtrl . removeTab ( scope ) ;
236
+ } ) ;
237
+
238
+ //We need to transclude later, once the content container is ready.
239
+ //when this link happens, we're inside a tab heading.
240
+ scope . $transcludeFn = transclude ;
243
241
}
244
242
} ;
245
243
} ] )
0 commit comments