aboutsummaryrefslogtreecommitdiffstats
path: root/themes/default/js/ui/jquery.ui.menu.js
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2013-02-18 21:18:40 +0000
committerrvelices <rv-github@modusoptimus.com>2013-02-18 21:18:40 +0000
commit74373ea7175bcf6be2732e6d59f037f79f88ca96 (patch)
treee8799eea7707f9aae6ba3ccb2aa7ce315f0be383 /themes/default/js/ui/jquery.ui.menu.js
parentf2da009c0f744c9197c652c5012323e69dd96308 (diff)
upgraded jquery ui from 1.9.0 to 1.10.1
git-svn-id: http://piwigo.org/svn/trunk@20824 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'themes/default/js/ui/jquery.ui.menu.js')
-rw-r--r--themes/default/js/ui/jquery.ui.menu.js78
1 files changed, 45 insertions, 33 deletions
diff --git a/themes/default/js/ui/jquery.ui.menu.js b/themes/default/js/ui/jquery.ui.menu.js
index 01f402012..64206409c 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.9.0
+ * jQuery UI Menu 1.10.1
* http://jqueryui.com
*
- * Copyright 2012 jQuery Foundation and other contributors
+ * Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
@@ -15,10 +15,8 @@
*/
(function( $, undefined ) {
-var mouseHandled = false;
-
$.widget( "ui.menu", {
- version: "1.9.0",
+ version: "1.10.1",
defaultElement: "<ul>",
delay: 300,
options: {
@@ -40,6 +38,9 @@ $.widget( "ui.menu", {
_create: function() {
this.activeMenu = this.element;
+ // flag used to prevent firing of the click handler
+ // as the event bubbles up through nested menus
+ this.mouseHandled = false;
this.element
.uniqueId()
.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
@@ -73,8 +74,8 @@ $.widget( "ui.menu", {
},
"click .ui-menu-item:has(a)": function( event ) {
var target = $( event.target ).closest( ".ui-menu-item" );
- if ( !mouseHandled && target.not( ".ui-state-disabled" ).length ) {
- mouseHandled = true;
+ if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
+ this.mouseHandled = true;
this.select( event );
// Open submenu on click
@@ -130,7 +131,7 @@ $.widget( "ui.menu", {
}
// Reset the mouseHandled flag
- mouseHandled = false;
+ this.mouseHandled = false;
}
});
},
@@ -139,7 +140,7 @@ $.widget( "ui.menu", {
// Destroy (sub)menus
this.element
.removeAttr( "aria-activedescendant" )
- .find( ".ui-menu" ).andSelf()
+ .find( ".ui-menu" ).addBack()
.removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" )
.removeAttr( "role" )
.removeAttr( "tabIndex" )
@@ -173,6 +174,7 @@ $.widget( "ui.menu", {
},
_keydown: function( event ) {
+ /*jshint maxcomplexity:20*/
var match, prev, character, skip, regex,
preventDefault = true;
@@ -277,21 +279,35 @@ $.widget( "ui.menu", {
},
refresh: function() {
- // Initialize nested menus
var menus,
icon = this.options.icons.submenu,
- submenus = this.element.find( this.options.menus + ":not(.ui-menu)" )
- .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
- .hide()
- .attr({
- role: this.options.role,
- "aria-hidden": "true",
- "aria-expanded": "false"
- });
+ submenus = this.element.find( this.options.menus );
+
+ // Initialize nested menus
+ submenus.filter( ":not(.ui-menu)" )
+ .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
+ .hide()
+ .attr({
+ role: this.options.role,
+ "aria-hidden": "true",
+ "aria-expanded": "false"
+ })
+ .each(function() {
+ var menu = $( this ),
+ item = menu.prev( "a" ),
+ submenuCarat = $( "<span>" )
+ .addClass( "ui-menu-icon ui-icon " + icon )
+ .data( "ui-menu-submenu-carat", true );
+
+ item
+ .attr( "aria-haspopup", "true" )
+ .prepend( submenuCarat );
+ menu.attr( "aria-labelledby", item.attr( "id" ) );
+ });
- // Don't refresh list items that are already adapted
menus = submenus.add( this.element );
+ // Don't refresh list items that are already adapted
menus.children( ":not(.ui-menu-item):has(a)" )
.addClass( "ui-menu-item" )
.attr( "role", "presentation" )
@@ -307,7 +323,7 @@ $.widget( "ui.menu", {
menus.children( ":not(.ui-menu-item)" ).each(function() {
var item = $( this );
// hyphen, em dash, en dash
- if ( !/[^\-—–\s]/.test( item.text() ) ) {
+ if ( !/[^\-\u2014\u2013\s]/.test( item.text() ) ) {
item.addClass( "ui-widget-content ui-menu-divider" );
}
});
@@ -315,19 +331,6 @@ $.widget( "ui.menu", {
// Add aria-disabled attribute to any disabled menu item
menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
- submenus.each(function() {
- var menu = $( this ),
- item = menu.prev( "a" ),
- submenuCarat = $( "<span>" )
- .addClass( "ui-menu-icon ui-icon " + icon )
- .data( "ui-menu-submenu-carat", true );
-
- item
- .attr( "aria-haspopup", "true" )
- .prepend( submenuCarat );
- menu.attr( "aria-labelledby", item.attr( "id" ) );
- });
-
// If the active item has been removed, blur the menu
if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
this.blur();
@@ -341,6 +344,15 @@ $.widget( "ui.menu", {
}[ this.options.role ];
},
+ _setOption: function( key, value ) {
+ if ( key === "icons" ) {
+ this.element.find( ".ui-menu-icon" )
+ .removeClass( this.options.icons.submenu )
+ .addClass( value.submenu );
+ }
+ this._super( key, value );
+ },
+
focus: function( event, item ) {
var nested, focused;
this.blur( event, event && event.type === "focus" );