mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
25 lines
509 B
JavaScript
25 lines
509 B
JavaScript
define( [
|
|
"jquery",
|
|
"ui/safe-active-element",
|
|
"ui/widgets/button"
|
|
], function( $ ) {
|
|
|
|
module( "Button: core" );
|
|
|
|
asyncTest( "Disabled button loses focus", function() {
|
|
expect( 2 );
|
|
var element = $( "#button" ).button();
|
|
|
|
element.focus();
|
|
setTimeout( function() {
|
|
|
|
equal( element[ 0 ], $.ui.safeActiveElement( document ), "Button is focused" );
|
|
|
|
element.button( "disable" );
|
|
notEqual( element[ 0 ], $.ui.safeActiveElement( document ), "Button has had focus removed" );
|
|
start();
|
|
} );
|
|
} );
|
|
|
|
} );
|