diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-09-12 23:37:14 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-09-12 23:37:14 +0200 |
commit | 2a6ca3fb394f2caee6ad92c4dfc76ac66553cd46 (patch) | |
tree | 429e26e4dc650b865f5beffbecc64f2f6f1d2278 /ui/jquery.ui.widget.js | |
parent | d12180d1a5ae5f07f112aaeebbfc295f2fe104d8 (diff) | |
download | jquery-ui-2a6ca3fb394f2caee6ad92c4dfc76ac66553cd46.tar.gz jquery-ui-2a6ca3fb394f2caee6ad92c4dfc76ac66553cd46.zip |
Widget: Add a _delay method. Will be used in various places to replace setTimeout with custom binding (mostly getting rid of var self/that)
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r-- | ui/jquery.ui.widget.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 5b7942600..729e14cf9 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -333,6 +333,15 @@ $.Widget.prototype = { }); }, + _delay: function( handler, delay ) { + function handlerProxy() { + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + var instance = this; + setTimeout( handlerProxy, delay || 0 ); + }, + _hoverable: function( element ) { this.hoverable = this.hoverable.add( element ); this._bind( element, { |