aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Bolter <david.bolter@gmail.com>2008-09-22 18:21:38 +0000
committerDavid Bolter <david.bolter@gmail.com>2008-09-22 18:21:38 +0000
commit5f9ffb28d33588ce006d980dfb07680c5d12f7d5 (patch)
tree365505ec6e4b325e8c9565333821767d7ea1e8b8
parentfb3a5d40106a83d10734f203189dc390cfaa0b94 (diff)
downloadjquery-ui-5f9ffb28d33588ce006d980dfb07680c5d12f7d5.tar.gz
jquery-ui-5f9ffb28d33588ce006d980dfb07680c5d12f7d5.zip
Accept boolean values for aria state. (Thanks for catch Scott González)
-rw-r--r--tests/core.js4
-rw-r--r--ui/ui.core.js2
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/core.js b/tests/core.js
index f9885e684..d4ec79373 100644
--- a/tests/core.js
+++ b/tests/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);
diff --git a/ui/ui.core.js b/ui/ui.core.js
index be0caa920..1ac19b7ff 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -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);