this._bind( document, {
click: function( event ) {
if ( !$( event.target ).closest( ".ui-menu" ).length ) {
- this.closeAll();
+ this.collapseAll();
}
}
});
.position( position );
},
- closeAll: function() {
+ collapseAll: function() {
this.element
.find( "ul" )
.hide()
},
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 );
}
});
});
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 );
if ( !this.active || !this.active.length )
return;
this.active
- .menu( "closeAll" )
+ .menu( "collapseAll" )
.hide()
.attr( "aria-hidden", "true" )
.attr( "aria-expanded", "false" );
// 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" );