mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Accept boolean values for aria state. (Thanks for catch Scott González)
This commit is contained in:
parent
fb3a5d4010
commit
5f9ffb28d3
@ -64,8 +64,8 @@ test("aria", function() {
|
||||
equals($('#aria').ariaRole(), 'tablist', 'role is tablist via ariaRole');
|
||||
ok(!$('#aria').attr('expanded'), 'state expanded absent via attr');
|
||||
ok(!$('#aria').ariaState('expanded'), 'state expanded absent via ariaState');
|
||||
equals($('#aria').ariaState('expanded', 'true').ariaState('expanded'), 'true', 'aria expanded is true');
|
||||
equals($('#aria').ariaState('expanded', 'false').ariaState('expanded'), 'false', 'aria expanded is false');
|
||||
equals($('#aria').ariaState('expanded', true).ariaState('expanded'), 'true', 'aria expanded is true');
|
||||
equals($('#aria').ariaState('expanded', false).ariaState('expanded'), 'false', 'aria expanded is false');
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
@ -454,7 +454,7 @@ $.fn.extend({
|
||||
|
||||
ariaState : function(state, value) {
|
||||
// setter?
|
||||
if (value)
|
||||
if (value !== undefined)
|
||||
return this.each(function(i, el) {
|
||||
isFF2? el.setAttributeNS("http://www.w3.org/2005/07/aaa", "aaa:" + state, value) :
|
||||
$(el).attr("aria-" + state, value);
|
||||
|
Loading…
Reference in New Issue
Block a user