diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2014-02-21 13:22:39 +0100 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2014-02-21 19:57:34 +0100 |
commit | df6110c0d424ff3306fdd5576011f2dcf4d242d0 (patch) | |
tree | ccf0b23716deebd37e27578e01d5b9b1790d5a16 /ui/core.js | |
parent | 1c278f97fca0aa1f3a473396e15c217419a99746 (diff) | |
download | jquery-ui-df6110c0d424ff3306fdd5576011f2dcf4d242d0.tar.gz jquery-ui-df6110c0d424ff3306fdd5576011f2dcf4d242d0.zip |
Core: Deprecate .focus( n ), replace in dialog with explicit timeouts
Fixes #9646
Diffstat (limited to 'ui/core.js')
-rw-r--r-- | ui/core.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/ui/core.js b/ui/core.js index 7323baeeb..a946d522b 100644 --- a/ui/core.js +++ b/ui/core.js @@ -48,22 +48,6 @@ $.extend( $.ui, { // plugins $.fn.extend({ - focus: (function( orig ) { - return function( delay, fn ) { - return typeof delay === "number" ? - this.each(function() { - var elem = this; - setTimeout(function() { - $( elem ).focus(); - if ( fn ) { - fn.call( elem ); - } - }, delay ); - }) : - orig.apply( this, arguments ); - }; - })( $.fn.focus ), - scrollParent: function() { var position = this.css( "position" ), excludeStaticParent = position === "absolute", @@ -225,6 +209,22 @@ $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); $.support.selectstart = "onselectstart" in document.createElement( "div" ); $.fn.extend({ + focus: (function( orig ) { + return function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + orig.apply( this, arguments ); + }; + })( $.fn.focus ), + disableSelection: function() { return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + ".ui-disableSelection", function( event ) { |