File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
-
2
1
angular . module ( 'ui.directives' )
3
2
. directive ( 'uiModal' , [ '$timeout' , function ( $timeout ) {
4
3
return {
4
+ restrict : 'EAC' ,
5
5
require : 'ngModel' ,
6
6
link : function ( scope , elm , attrs , model ) {
7
7
//helper so you don't have to type class="modal hide"
8
- elm . addClass ( 'modal hide' ) ;
8
+ elm . addClass ( 'modal hide' ) ;
9
9
scope . $watch ( attrs . ngModel , function ( value ) {
10
- elm . modal ( value && 'show' || 'hide' ) ;
10
+ elm . modal ( value && 'show' || 'hide' ) ;
11
11
} ) ;
12
12
elm . on ( 'show.ui' , function ( ) {
13
- $timeout ( function ( ) {
14
- model . $setViewValue ( true ) ;
15
- } ) ;
13
+ $timeout ( function ( ) {
14
+ model . $setViewValue ( true ) ;
15
+ } ) ;
16
16
} ) ;
17
17
elm . on ( 'hide.ui' , function ( ) {
18
18
$timeout ( function ( ) {
19
- model . $setViewValue ( false ) ;
19
+ model . $setViewValue ( false ) ;
20
20
} ) ;
21
21
} ) ;
22
22
}
23
23
} ;
24
- } ] ) ;
24
+ } ] ) ;
You can’t perform that action at this time.
0 commit comments