module( "core - deprecated" );
-asyncTest( "focus - original functionality", function() {
- expect( 1 );
- $( "#inputTabindex0" )
- .one( "focus", function() {
- ok( true, "event triggered" );
- start();
- })
- .focus();
-});
-
-asyncTest( "focus", function() {
- expect( 2 );
-
- // support: IE 8
- // IE sometimes gets confused about what's focused if we don't explicitly
- // focus a different element first
- $( "body" ).focus();
-
- $( "#inputTabindex0" )
- .one( "focus", function() {
- ok( true, "event triggered" );
- start();
- })
- .focus( 500, function() {
- ok( true, "callback triggered" );
- });
-});
-
test( "zIndex", function() {
expect( 7 );
var el = $( "#zIndexAutoWithParent" ),
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
$.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() {
var eventType = "onselectstart" in document.createElement( "div" ) ?
"selectstart" :