Skip to content
Permalink
Browse files

Accept boolean values for aria state. (Thanks for catch Scott González)

  • Loading branch information...
dbolter committed Sep 22, 2008
1 parent fb3a5d4 commit 5f9ffb28d33588ce006d980dfb07680c5d12f7d5
Showing with 3 additions and 3 deletions.
  1. +2 −2 tests/core.js
  2. +1 −1 ui/ui.core.js
@@ -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);

0 comments on commit 5f9ffb2

Please sign in to comment.
You can’t perform that action at this time.