]> source.dussan.org Git - jquery-ui.git/commitdiff
Merge branch 'master' into menubar
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 26 Apr 2011 20:05:44 +0000 (22:05 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 26 Apr 2011 20:05:44 +0000 (22:05 +0200)
Conflicts:
ui/jquery.ui.menu.js

1  2 
ui/jquery.ui.menu.js

index 8738f5c27428f51c512c449c47a1a1bdf92b13de,7c0c8d3d35f7864ebaae9467081fae3169f35cdf..0f585d9761018d9c56b3aa53716579d587a8b3ae
@@@ -212,17 -197,7 +215,17 @@@ $.widget("ui.menu", 
                
                items.children( "a" )
                        .addClass( "ui-corner-all" )
 -                      .attr( "tabIndex", -1 );
 +                      .attr( "tabIndex", -1 )
 +                      .attr( "role", "menuitem" )
 +                      .attr("id", function(i) {return self.element.attr("id") + "-" + i});
 +              
 +              submenus.each(function() {
 +                      var menu = $(this);
 +                      var item = menu.prev("a") 
 +                      item.attr("aria-haspopup", "true")
-                       .prepend('<span class="ui-icon ui-icon-carat-1-e"></span>');
++                      .prepend('<span class="ui-menu-icon ui-icon ui-icon-carat-1-e"></span>');
 +                      menu.attr("aria-labelledby", item.attr("id"));
 +              });
        },
  
        focus: function( event, item ) {
                this.active = item.first()
                        .children( "a" )
                                .addClass( "ui-state-focus" )
 -                              .attr( "id", function(index, id) {
 -                                      return (self.itemId = id || self.menuId + "-activedescendant");
 -                              })
                        .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)
 +              self.element.attr("aria-activedescendant", self.active.children("a").attr("id"))
+               // highlight active parent menu item, if any
+               this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active");
                
                self.timer = setTimeout(function() {
                        self._close();
                        ? this.options.position(this.active)
                        : this.options.position
                );
 -
 -              submenu.show().position(position);
 +              submenu.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(position);
-               this.active.find(">a:first").addClass("ui-state-active");
        },
        
        closeAll: function() {