aboutsummaryrefslogtreecommitdiffstats
path: root/themes/default/js/ui/jquery.ui.menu.js
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/js/ui/jquery.ui.menu.js')
-rw-r--r--themes/default/js/ui/jquery.ui.menu.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/themes/default/js/ui/jquery.ui.menu.js b/themes/default/js/ui/jquery.ui.menu.js
index 64206409c..226961993 100644
--- a/themes/default/js/ui/jquery.ui.menu.js
+++ b/themes/default/js/ui/jquery.ui.menu.js
@@ -1,8 +1,8 @@
/*!
- * jQuery UI Menu 1.10.1
+ * jQuery UI Menu 1.10.4
* http://jqueryui.com
*
- * Copyright 2013 jQuery Foundation and other contributors
+ * Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
@@ -16,7 +16,7 @@
(function( $, undefined ) {
$.widget( "ui.menu", {
- version: "1.10.1",
+ version: "1.10.4",
defaultElement: "<ul>",
delay: 300,
options: {
@@ -75,13 +75,18 @@ $.widget( "ui.menu", {
"click .ui-menu-item:has(a)": function( event ) {
var target = $( event.target ).closest( ".ui-menu-item" );
if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
- this.mouseHandled = true;
-
this.select( event );
+
+ // Only set the mouseHandled flag if the event will bubble, see #9469.
+ if ( !event.isPropagationStopped() ) {
+ this.mouseHandled = true;
+ }
+
// Open submenu on click
if ( target.has( ".ui-menu" ).length ) {
this.expand( event );
- } else if ( !this.element.is( ":focus" ) ) {
+ } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
+
// Redirect focus to the menu
this.element.trigger( "focus", [ true ] );
@@ -174,7 +179,6 @@ $.widget( "ui.menu", {
},
_keydown: function( event ) {
- /*jshint maxcomplexity:20*/
var match, prev, character, skip, regex,
preventDefault = true;
@@ -283,6 +287,8 @@ $.widget( "ui.menu", {
icon = this.options.icons.submenu,
submenus = this.element.find( this.options.menus );
+ this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
+
// Initialize nested menus
submenus.filter( ":not(.ui-menu)" )
.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
@@ -383,7 +389,7 @@ $.widget( "ui.menu", {
}
nested = item.children( ".ui-menu" );
- if ( nested.length && ( /^mouse/.test( event.type ) ) ) {
+ if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
this._startOpening(nested);
}
this.activeMenu = item.parent();