Skip to content
Permalink
Browse files

Menu: Changed closeAll to collapseAll and updated in Menubar, also up…

…dated a reference to left in Menubar to collapse.
  • Loading branch information...
kborchers authored and jzaefferer committed Jul 14, 2011
1 parent 11d24ee commit 6d0859f71600c3776913f90a39e9cfe086454e11
Showing with 7 additions and 7 deletions.
  1. +4 −4 ui/jquery.ui.menu.js
  2. +3 −3 ui/jquery.ui.menubar.js
@@ -176,7 +176,7 @@ $.widget( "ui.menu", {
this._bind( document, {
click: function( event ) {
if ( !$( event.target ).closest( ".ui-menu" ).length ) {
this.closeAll();
this.collapseAll();
}
}
});
@@ -336,7 +336,7 @@ $.widget( "ui.menu", {
.position( position );
},

closeAll: function() {
collapseAll: function() {
this.element
.find( "ul" )
.hide()
@@ -466,11 +466,11 @@ $.widget( "ui.menu", {
},

select: function( event ) {
// save active reference before closeAll triggers blur
// save active reference before collapseAll triggers blur
var ui = {
item: this.active
};
this.closeAll();
this.collapseAll();
this._trigger( "select", event, ui );
}
});
@@ -151,7 +151,7 @@ $.widget( "ui.menubar", {
});
that._bind( {
keydown: function( event ) {
if ( event.keyCode == $.ui.keyCode.ESCAPE && that.active && that.active.menu( "left", event ) !== true ) {
if ( event.keyCode == $.ui.keyCode.ESCAPE && that.active && that.active.menu( "collapse", event ) !== true ) {
var active = that.active;
that.active.blur();
that._close( event );
@@ -206,7 +206,7 @@ $.widget( "ui.menubar", {
if ( !this.active || !this.active.length )
return;
this.active
.menu( "closeAll" )
.menu( "collapseAll" )
.hide()
.attr( "aria-hidden", "true" )
.attr( "aria-expanded", "false" );
@@ -226,7 +226,7 @@ $.widget( "ui.menubar", {
// TODO refactor, almost the same as _close above, but don't remove tabIndex
if ( this.active ) {
this.active
.menu( "closeAll" )
.menu( "collapseAll" )
.hide()
.attr( "aria-hidden", "true" )
.attr( "aria-expanded", "false" );

0 comments on commit 6d0859f

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