This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree 3 files changed +12
-8
lines changed
3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ AngularJS version of the tabs directive.
29
29
30
30
* ` deselect() `
31
31
<small class =" badge " >$</small > -
32
- An optional expression called when tab is deactivated.
32
+ An optional expression called when tab is deactivated. Supports $event in template for expression.
33
33
34
34
* ` disable `
35
35
<small class =" badge " >$</small >
@@ -45,7 +45,7 @@ AngularJS version of the tabs directive.
45
45
46
46
* ` select() `
47
47
<small class =" badge " >$</small > -
48
- An optional expression called when tab is activated.
48
+ An optional expression called when tab is activated. Supports $event in template for expression.
49
49
50
50
* ` template-url `
51
51
_ (Default: ` uib/template/tabs/tab.html ` )_ -
Original file line number Diff line number Diff line change @@ -5,18 +5,22 @@ angular.module('ui.bootstrap.tabs', [])
5
5
oldIndex ;
6
6
ctrl . tabs = [ ] ;
7
7
8
- ctrl . select = function ( index ) {
8
+ ctrl . select = function ( index , evt ) {
9
9
if ( ! destroyed ) {
10
10
var previousIndex = findTabIndex ( oldIndex ) ;
11
11
var previousSelected = ctrl . tabs [ previousIndex ] ;
12
12
if ( previousSelected ) {
13
- previousSelected . tab . onDeselect ( ) ;
13
+ previousSelected . tab . onDeselect ( {
14
+ $event : evt
15
+ } ) ;
14
16
previousSelected . tab . active = false ;
15
17
}
16
18
17
19
var selected = ctrl . tabs [ index ] ;
18
20
if ( selected ) {
19
- selected . tab . onSelect ( ) ;
21
+ selected . tab . onSelect ( {
22
+ $event : evt
23
+ } ) ;
20
24
selected . tab . active = true ;
21
25
ctrl . active = selected . index ;
22
26
oldIndex = selected . index ;
@@ -143,7 +147,7 @@ angular.module('ui.bootstrap.tabs', [])
143
147
}
144
148
}
145
149
146
- scope . select = function ( ) {
150
+ scope . select = function ( evt ) {
147
151
if ( ! scope . disabled ) {
148
152
var index ;
149
153
for ( var i = 0 ; i < tabsetCtrl . tabs . length ; i ++ ) {
@@ -153,7 +157,7 @@ angular.module('ui.bootstrap.tabs', [])
153
157
}
154
158
}
155
159
156
- tabsetCtrl . select ( index ) ;
160
+ tabsetCtrl . select ( index , evt ) ;
157
161
}
158
162
} ;
159
163
Original file line number Diff line number Diff line change 1
1
< li ng-class ="{active: active, disabled: disabled} " class ="uib-tab nav-item ">
2
- < a href ng-click ="select() " class ="nav-link " uib-tab-heading-transclude > {{heading}}</ a >
2
+ < a href ng-click ="select($event ) " class ="nav-link " uib-tab-heading-transclude > {{heading}}</ a >
3
3
</ li >
You can’t perform that action at this time.
0 commit comments