aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-04-18 13:04:07 +0000
committerScott González <scott.gonzalez@gmail.com>2009-04-18 13:04:07 +0000
commitcedf663e2f13bb24a1e473c55e49248d98be3f16 (patch)
tree60b14eb1bf3bc61d5d2aaae5db6b91c741c6fb4c /ui
parent15788355faa24262a62c5883af40e41239ef6021 (diff)
downloadjquery-ui-cedf663e2f13bb24a1e473c55e49248d98be3f16.tar.gz
jquery-ui-cedf663e2f13bb24a1e473c55e49248d98be3f16.zip
Core: Added asynchronous focus. Fixed #3559 - :focusable, :tabbable, setFocus().
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.core.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js
index 27b12681d..4068f9630 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -135,6 +135,19 @@ if (isFF2) {
//jQuery plugins
$.fn.extend({
+ _focus: $.fn.focus,
+ focus: function(delay, fn) {
+ return typeof delay === 'number'
+ ? this.each(function() {
+ var elem = this;
+ setTimeout(function() {
+ $(elem).focus();
+ (fn && fn.call(elem));
+ }, delay);
+ })
+ : this._focus.apply(this, arguments);
+ },
+
remove: function() {
// Safari has a native remove event which actually removes DOM elements,
// so we have to use triggerHandler instead of trigger (#3037).