@@ -238,7 +238,7 @@ angular.module('ui.bootstrap.tabs', [])
238
238
. directive ( 'uibTabHeadingTransclude' , function ( ) {
239
239
return {
240
240
restrict : 'A' ,
241
- require : [ '? ^uibTab', '?^tab' ] , // TODO: change to '^uibTab' after deprecation removal
241
+ require : ' ^uibTab',
242
242
link : function ( scope , elm ) {
243
243
scope . $watch ( 'headingElement' , function updateHeadingElement ( heading ) {
244
244
if ( heading ) {
@@ -253,7 +253,7 @@ angular.module('ui.bootstrap.tabs', [])
253
253
. directive ( 'uibTabContentTransclude' , function ( ) {
254
254
return {
255
255
restrict : 'A' ,
256
- require : [ '? ^uibTabset', '?^tabset' ] , // TODO: change to '^uibTabset' after deprecation removal
256
+ require : ' ^uibTabset',
257
257
link : function ( scope , elm , attrs ) {
258
258
var tab = scope . $eval ( attrs . uibTabContentTransclude ) ;
259
259
@@ -274,166 +274,12 @@ angular.module('ui.bootstrap.tabs', [])
274
274
275
275
function isTabHeading ( node ) {
276
276
return node . tagName && (
277
- node . hasAttribute ( 'tab-heading' ) || // TODO: remove after deprecation removal
278
- node . hasAttribute ( 'data-tab-heading' ) || // TODO: remove after deprecation removal
279
- node . hasAttribute ( 'x-tab-heading' ) || // TODO: remove after deprecation removal
280
277
node . hasAttribute ( 'uib-tab-heading' ) ||
281
278
node . hasAttribute ( 'data-uib-tab-heading' ) ||
282
279
node . hasAttribute ( 'x-uib-tab-heading' ) ||
283
- node . tagName . toLowerCase ( ) === 'tab-heading' || // TODO: remove after deprecation removal
284
- node . tagName . toLowerCase ( ) === 'data-tab-heading' || // TODO: remove after deprecation removal
285
- node . tagName . toLowerCase ( ) === 'x-tab-heading' || // TODO: remove after deprecation removal
286
280
node . tagName . toLowerCase ( ) === 'uib-tab-heading' ||
287
281
node . tagName . toLowerCase ( ) === 'data-uib-tab-heading' ||
288
282
node . tagName . toLowerCase ( ) === 'x-uib-tab-heading'
289
283
) ;
290
284
}
291
285
} ) ;
292
-
293
- /* deprecated tabs below */
294
-
295
- angular . module ( 'ui.bootstrap.tabs' )
296
-
297
- . value ( '$tabsSuppressWarning' , false )
298
-
299
- . controller ( 'TabsetController' , [ '$scope' , '$controller' , '$log' , '$tabsSuppressWarning' , function ( $scope , $controller , $log , $tabsSuppressWarning ) {
300
- if ( ! $tabsSuppressWarning ) {
301
- $log . warn ( 'TabsetController is now deprecated. Use UibTabsetController instead.' ) ;
302
- }
303
-
304
- angular . extend ( this , $controller ( 'UibTabsetController' , {
305
- $scope : $scope
306
- } ) ) ;
307
- } ] )
308
-
309
- . directive ( 'tabset' , [ '$log' , '$tabsSuppressWarning' , function ( $log , $tabsSuppressWarning ) {
310
- return {
311
- restrict : 'EA' ,
312
- transclude : true ,
313
- replace : true ,
314
- scope : {
315
- type : '@'
316
- } ,
317
- controller : 'TabsetController' ,
318
- templateUrl : 'template/tabs/tabset.html' ,
319
- link : function ( scope , element , attrs ) {
320
-
321
- if ( ! $tabsSuppressWarning ) {
322
- $log . warn ( 'tabset is now deprecated. Use uib-tabset instead.' ) ;
323
- }
324
- scope . vertical = angular . isDefined ( attrs . vertical ) ? scope . $parent . $eval ( attrs . vertical ) : false ;
325
- scope . justified = angular . isDefined ( attrs . justified ) ? scope . $parent . $eval ( attrs . justified ) : false ;
326
- }
327
- } ;
328
- } ] )
329
-
330
- . directive ( 'tab' , [ '$parse' , '$log' , '$tabsSuppressWarning' , function ( $parse , $log , $tabsSuppressWarning ) {
331
- return {
332
- require : '^tabset' ,
333
- restrict : 'EA' ,
334
- replace : true ,
335
- templateUrl : 'template/tabs/tab.html' ,
336
- transclude : true ,
337
- scope : {
338
- active : '=?' ,
339
- heading : '@' ,
340
- onSelect : '&select' , //This callback is called in contentHeadingTransclude
341
- //once it inserts the tab's content into the dom
342
- onDeselect : '&deselect'
343
- } ,
344
- controller : function ( ) {
345
- //Empty controller so other directives can require being 'under' a tab
346
- } ,
347
- link : function ( scope , elm , attrs , tabsetCtrl , transclude ) {
348
- if ( ! $tabsSuppressWarning ) {
349
- $log . warn ( 'tab is now deprecated. Use uib-tab instead.' ) ;
350
- }
351
-
352
- scope . $watch ( 'active' , function ( active ) {
353
- if ( active ) {
354
- tabsetCtrl . select ( scope ) ;
355
- }
356
- } ) ;
357
-
358
- scope . disabled = false ;
359
- if ( attrs . disable ) {
360
- scope . $parent . $watch ( $parse ( attrs . disable ) , function ( value ) {
361
- scope . disabled = ! ! value ;
362
- } ) ;
363
- }
364
-
365
- scope . select = function ( ) {
366
- if ( ! scope . disabled ) {
367
- scope . active = true ;
368
- }
369
- } ;
370
-
371
- tabsetCtrl . addTab ( scope ) ;
372
- scope . $on ( '$destroy' , function ( ) {
373
- tabsetCtrl . removeTab ( scope ) ;
374
- } ) ;
375
-
376
- //We need to transclude later, once the content container is ready.
377
- //when this link happens, we're inside a tab heading.
378
- scope . $transcludeFn = transclude ;
379
- }
380
- } ;
381
- } ] )
382
-
383
- . directive ( 'tabHeadingTransclude' , [ '$log' , '$tabsSuppressWarning' , function ( $log , $tabsSuppressWarning ) {
384
- return {
385
- restrict : 'A' ,
386
- require : '^tab' ,
387
- link : function ( scope , elm ) {
388
- if ( ! $tabsSuppressWarning ) {
389
- $log . warn ( 'tab-heading-transclude is now deprecated. Use uib-tab-heading-transclude instead.' ) ;
390
- }
391
-
392
- scope . $watch ( 'headingElement' , function updateHeadingElement ( heading ) {
393
- if ( heading ) {
394
- elm . html ( '' ) ;
395
- elm . append ( heading ) ;
396
- }
397
- } ) ;
398
- }
399
- } ;
400
- } ] )
401
-
402
- . directive ( 'tabContentTransclude' , [ '$log' , '$tabsSuppressWarning' , function ( $log , $tabsSuppressWarning ) {
403
- return {
404
- restrict : 'A' ,
405
- require : '^tabset' ,
406
- link : function ( scope , elm , attrs ) {
407
- if ( ! $tabsSuppressWarning ) {
408
- $log . warn ( 'tab-content-transclude is now deprecated. Use uib-tab-content-transclude instead.' ) ;
409
- }
410
-
411
- var tab = scope . $eval ( attrs . tabContentTransclude ) ;
412
-
413
- //Now our tab is ready to be transcluded: both the tab heading area
414
- //and the tab content area are loaded. Transclude 'em both.
415
- tab . $transcludeFn ( tab . $parent , function ( contents ) {
416
- angular . forEach ( contents , function ( node ) {
417
- if ( isTabHeading ( node ) ) {
418
- //Let tabHeadingTransclude know.
419
- tab . headingElement = node ;
420
- }
421
- else {
422
- elm . append ( node ) ;
423
- }
424
- } ) ;
425
- } ) ;
426
- }
427
- } ;
428
-
429
- function isTabHeading ( node ) {
430
- return node . tagName && (
431
- node . hasAttribute ( 'tab-heading' ) ||
432
- node . hasAttribute ( 'data-tab-heading' ) ||
433
- node . hasAttribute ( 'x-tab-heading' ) ||
434
- node . tagName . toLowerCase ( ) === 'tab-heading' ||
435
- node . tagName . toLowerCase ( ) === 'data-tab-heading' ||
436
- node . tagName . toLowerCase ( ) === 'x-tab-heading'
437
- ) ;
438
- }
439
- } ] ) ;
0 commit comments