]> source.dussan.org Git - jquery-ui.git/commitdiff
Popup: Replace var that with this and _delay
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 12 Sep 2011 22:27:54 +0000 (00:27 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 12 Sep 2011 22:27:54 +0000 (00:27 +0200)
ui/jquery.ui.popup.js

index 8e5cf198cced8c737d92eae93f5b308197aa02b0..15349bc233147b73070aabe78f48377ac0c97490 100644 (file)
@@ -72,10 +72,9 @@ $.widget( "ui.popup", {
                                        // let it propagate to close
                                        return;
                                }
-                               var that = this;
                                clearTimeout( this.closeTimer );
-                               setTimeout(function() {
-                                       that.open( event );
+                               this._delay(function() {
+                                       this.open( event );
                                }, 1);
                        }
                });
@@ -102,11 +101,10 @@ $.widget( "ui.popup", {
 
                this._bind({
                        focusout: function( event ) {
-                               var that = this;
                                // use a timer to allow click to clear it and letting that
                                // handle the closing instead of opening again
-                               that.closeTimer = setTimeout( function() {
-                                       that.close( event );
+                               this.closeTimer = this._delay( function() {
+                                       this.close( event );
                                }, 100);
                        },
                        focusin: function( event ) {