aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorkborchers <k_borchers@yahoo.com>2011-07-19 16:15:59 -0500
committerCorey Frang <gnarf@gnarf.net>2011-07-19 16:15:59 -0500
commit8224c675e19bf5cb9ed0b00159dc572715ad7727 (patch)
treec1041c76e95dadba96098ee936ed1c7f1e17a036 /ui
parentc8a11ce4f0e5459a331fc2ac9f3e217a91452a22 (diff)
downloadjquery-ui-8224c675e19bf5cb9ed0b00159dc572715ad7727.tar.gz
jquery-ui-8224c675e19bf5cb9ed0b00159dc572715ad7727.zip
Menu: Passed the original event that causes a blur through collapseAll to blur, then trigger a blur on the menu. Fixes failing unit test provided by @rwaldron which has been included in this commit
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.menu.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js
index f6012de4f..4717946f1 100644
--- a/ui/jquery.ui.menu.js
+++ b/ui/jquery.ui.menu.js
@@ -176,7 +176,7 @@ $.widget( "ui.menu", {
this._bind( document, {
click: function( event ) {
if ( !$( event.target ).closest( ".ui-menu" ).length ) {
- this.collapseAll();
+ this.collapseAll( event );
}
}
});
@@ -249,7 +249,7 @@ $.widget( "ui.menu", {
var nested,
self = this;
- this.blur();
+ this.blur( event );
if ( this._hasScroll() ) {
var borderTop = parseFloat( $.curCSS( this.element[0], "borderTopWidth", true ) ) || 0,
@@ -297,6 +297,8 @@ $.widget( "ui.menu", {
this.active.children( "a" ).removeClass( "ui-state-focus" );
this.active = null;
+
+ this._trigger( "blur", event, { item: this.active } );
},
_startOpening: function( submenu ) {
@@ -336,7 +338,7 @@ $.widget( "ui.menu", {
.position( position );
},
- collapseAll: function() {
+ collapseAll: function( event ) {
this.element
.find( "ul" )
.hide()
@@ -346,7 +348,7 @@ $.widget( "ui.menu", {
.find( "a.ui-state-active" )
.removeClass( "ui-state-active" );
- this.blur();
+ this.blur( event );
this.activeMenu = this.element;
},
@@ -470,7 +472,7 @@ $.widget( "ui.menu", {
var ui = {
item: this.active
};
- this.collapseAll();
+ this.collapseAll( event );
this._trigger( "select", event, ui );
}
});