This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree 5 files changed +34
-4
lines changed
5 files changed +34
-4
lines changed Original file line number Diff line number Diff line change 25
25
< tab heading ="Vertical 1 "> Vertical content 1</ tab >
26
26
< tab heading ="Vertical 2 "> Vertical content 2</ tab >
27
27
</ tabset >
28
+
29
+ < hr />
30
+
31
+ < tabset justified ="true ">
32
+ < tab heading ="Justified "> Justified content</ tab >
33
+ < tab heading ="SJ "> Short Labeled Justified content</ tab >
34
+ < tab heading ="Long Justified "> Long Labeled Justified content</ tab >
35
+ </ tabset >
28
36
</ div >
Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ AngularJS version of the tabs directive.
8
8
_ (Defaults: false)_ :
9
9
Whether tabs appear vertically stacked.
10
10
11
+ * ` justified `
12
+ _ (Defaults: false)_ :
13
+ Whether tabs fill the container and have a consistent width.
14
+
11
15
* ` type `
12
16
_ (Defaults: 'tabs')_ :
13
17
Navigation type. Possible values are 'tabs' and 'pills'.
Original file line number Diff line number Diff line change @@ -48,19 +48,24 @@ angular.module('ui.bootstrap.tabs', [])
48
48
* Tabset is the outer container for the tabs directive
49
49
*
50
50
* @param {boolean= } vertical Whether or not to use vertical styling for the tabs.
51
+ * @param {boolean= } justified Whether or not to use justified styling for the tabs.
51
52
*
52
53
* @example
53
54
<example module="ui.bootstrap">
54
55
<file name="index.html">
55
56
<tabset>
56
- <tab heading="Vertical Tab 1"><b>First</b> Content!</tab>
57
- <tab heading="Vertical Tab 2"><i>Second</i> Content!</tab>
57
+ <tab heading="Tab 1"><b>First</b> Content!</tab>
58
+ <tab heading="Tab 2"><i>Second</i> Content!</tab>
58
59
</tabset>
59
60
<hr />
60
61
<tabset vertical="true">
61
62
<tab heading="Vertical Tab 1"><b>First</b> Vertical Content!</tab>
62
63
<tab heading="Vertical Tab 2"><i>Second</i> Vertical Content!</tab>
63
64
</tabset>
65
+ <tabset justified="true">
66
+ <tab heading="Justified Tab 1"><b>First</b> Justified Content!</tab>
67
+ <tab heading="Justified Tab 2"><i>Second</i> Justified Content!</tab>
68
+ </tabset>
64
69
</file>
65
70
</example>
66
71
*/
@@ -74,6 +79,7 @@ angular.module('ui.bootstrap.tabs', [])
74
79
templateUrl : 'template/tabs/tabset.html' ,
75
80
link : function ( scope , element , attrs ) {
76
81
scope . vertical = angular . isDefined ( attrs . vertical ) ? scope . $parent . $eval ( attrs . vertical ) : false ;
82
+ scope . justified = angular . isDefined ( attrs . justified ) ? scope . $parent . $eval ( attrs . justified ) : false ;
77
83
scope . type = angular . isDefined ( attrs . type ) ? scope . $parent . $eval ( attrs . type ) : 'tabs' ;
78
84
}
79
85
} ;
Original file line number Diff line number Diff line change @@ -546,6 +546,19 @@ describe('tabs', function() {
546
546
} ) ;
547
547
} ) ;
548
548
549
+ describe ( 'justified' , function ( ) {
550
+ beforeEach ( inject ( function ( $compile , $rootScope ) {
551
+ scope = $rootScope . $new ( ) ;
552
+ scope . justified = true ;
553
+ elm = $compile ( '<tabset justified="justified"></tabset>' ) ( scope ) ;
554
+ scope . $apply ( ) ;
555
+ } ) ) ;
556
+
557
+ it ( 'to justify tabs' , function ( ) {
558
+ expect ( elm . find ( 'ul.nav-tabs' ) ) . toHaveClass ( 'nav-justified' ) ;
559
+ } ) ;
560
+ } ) ;
561
+
549
562
describe ( 'type' , function ( ) {
550
563
beforeEach ( inject ( function ( $compile , $rootScope ) {
551
564
scope = $rootScope . $new ( ) ;
Original file line number Diff line number Diff line change 1
1
2
2
< div class ="tabbable ">
3
- < ul class ="nav {{type && 'nav-' + type}} " ng-class ="{'nav-stacked': vertical} " ng-transclude >
4
- </ ul >
3
+ < ul class ="nav {{type && 'nav-' + type}} " ng-class ="{'nav-stacked': vertical, 'nav-justified': justified} " ng-transclude > </ ul >
5
4
< div class ="tab-content ">
6
5
< div class ="tab-pane "
7
6
ng-repeat ="tab in tabs "
You can’t perform that action at this time.
0 commit comments