File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ $.widget( "ui.popup", {
39
39
this . _bind ( this . options . trigger , {
40
40
keydown : function ( event ) {
41
41
// prevent space-to-open to scroll the page
42
+ // TODO do this only for a:ui-button?
42
43
if ( event . keyCode == $ . ui . keyCode . SPACE ) {
43
44
event . preventDefault ( )
44
45
}
@@ -50,16 +51,22 @@ $.widget( "ui.popup", {
50
51
return ;
51
52
}
52
53
var that = this ;
54
+ clearTimeout ( this . closeTimer ) ;
53
55
setTimeout ( function ( ) {
54
56
that . open ( event ) ;
55
57
} , 1 ) ;
56
58
}
57
59
} ) ;
58
60
59
61
this . _bind ( this . element , {
60
- // TODO also triggered when open and clicking the trigger again
61
- // figure out how to close in that case, while still closing on regular blur
62
- //blur: "close"
62
+ blur : function ( event ) {
63
+ var that = this ;
64
+ // use a timer to allow click to clear it and letting that
65
+ // handle the closing instead of opening again
66
+ that . closeTimer = setTimeout ( function ( ) {
67
+ that . close ( event ) ;
68
+ } , 100 ) ;
69
+ }
63
70
} ) ;
64
71
65
72
this . _bind ( {
You can’t perform that action at this time.
0 commit comments