aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.menu.js
diff options
context:
space:
mode:
authormaggiewachs <maggie@filamentgroup.com>2011-02-24 11:44:47 -0500
committermaggiewachs <maggie@filamentgroup.com>2011-02-24 11:44:47 -0500
commitadf80bfb38ba20eb089633c8867bce4131ec1e23 (patch)
tree1b598fcf8fb31d9ad9017502852e2cd3def82d94 /ui/jquery.ui.menu.js
parent9e7820a25819351177505f1346b9f1c06a3e8716 (diff)
downloadjquery-ui-adf80bfb38ba20eb089633c8867bce4131ec1e23.tar.gz
jquery-ui-adf80bfb38ba20eb089633c8867bce4131ec1e23.zip
Added active state toggle to items with submenus to provide "breadcrumb" feedback
Diffstat (limited to 'ui/jquery.ui.menu.js')
-rw-r--r--ui/jquery.ui.menu.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js
index 3915c3301..93b75326f 100644
--- a/ui/jquery.ui.menu.js
+++ b/ui/jquery.ui.menu.js
@@ -213,12 +213,13 @@ $.widget("ui.menu", {
.end();
// need to remove the attribute before adding it for the screenreader to pick up the change
// see http://groups.google.com/group/jquery-a11y/msg/929e0c1e8c5efc8f
- this.element.removeAttr("aria-activedescendant").attr("aria-activedescendant", self.itemId);
-
+ this.element.removeAttr("aria-activedescendant").attr("aria-activedescendant", self.itemId)
+
self._close();
var nested = $(">ul", item);
if (nested.length && /^mouse/.test(event.type)) {
self._open(nested);
+ this.active.find(">a:first").addClass("ui-state-active");
}
this.activeMenu = item.parent();
@@ -229,7 +230,7 @@ $.widget("ui.menu", {
if (!this.active) {
return;
}
-
+
this.active.children( "a" ).removeClass( "ui-state-focus" );
// remove only generated id
$( "#" + this.menuId + "-activedescendant" ).removeAttr( "id" );
@@ -261,7 +262,9 @@ $.widget("ui.menu", {
},
_close: function() {
- this.active.parent().find("ul").hide();
+ this.active.parent()
+ .find("ul").hide().end()
+ .find("a.ui-state-active").removeClass("ui-state-active");
},
left: function(event) {