File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,18 @@ var docsApp = {
5
5
} ;
6
6
7
7
8
- docsApp . directive . focused = function ( $defer ) {
8
+ docsApp . directive . focused = function ( $timeout ) {
9
9
return function ( scope , element , attrs ) {
10
10
element [ 0 ] . focus ( ) ;
11
11
element . bind ( 'focus' , function ( ) {
12
12
scope . $apply ( attrs . focused + '=true' ) ;
13
13
} ) ;
14
14
element . bind ( 'blur' , function ( ) {
15
- // have to use defer , so that we close the drop-down after the user clicks,
15
+ // have to use $timeout , so that we close the drop-down after the user clicks,
16
16
// otherwise when the user clicks we process the closing before we process the click.
17
- $defer ( attrs . focused + '=false' ) ;
17
+ $timeout ( function ( ) {
18
+ scope . $eval ( attrs . focused + '=false' ) ;
19
+ } ) ;
18
20
} ) ;
19
21
scope . $eval ( attrs . focused + '=true' )
20
22
}
You can’t perform that action at this time.
0 commit comments