2010-01-20 14:00:14 +00:00
|
|
|
/*
|
|
|
|
* button_events.js
|
|
|
|
*/
|
2012-11-19 13:37:41 +00:00
|
|
|
(function($) {
|
2010-01-20 14:00:14 +00:00
|
|
|
|
|
|
|
module("button: events");
|
|
|
|
|
2012-11-19 13:37:41 +00:00
|
|
|
test("buttonset works with single-quote named elements (#7505)", function() {
|
|
|
|
expect( 1 );
|
|
|
|
$("#radio3").buttonset();
|
|
|
|
$("#radio33").click( function(){
|
|
|
|
ok( true, "button clicks work with single-quote named elements" );
|
|
|
|
}).click();
|
|
|
|
});
|
|
|
|
|
2012-11-21 13:33:43 +00:00
|
|
|
test( "when button loses focus, ensure active state is removed (#8559)", function() {
|
|
|
|
expect( 1 );
|
|
|
|
|
|
|
|
$("#button").button().keypress( function() {
|
2012-11-22 00:29:22 +00:00
|
|
|
$("#button").one( "blur", function() {
|
2012-11-21 13:33:43 +00:00
|
|
|
ok( !$("#button").is(".ui-state-active"), "button loses active state appropriately" );
|
|
|
|
}).blur();
|
|
|
|
}).focus().simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ).simulate( "keypress", { keyCode: $.ui.keyCode.ENTER } );
|
|
|
|
});
|
|
|
|
|
2010-01-20 14:00:14 +00:00
|
|
|
})(jQuery);
|