From bed90bb409dc421c3f1d4a813efd8d14abf83f69 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Thu, 25 Apr 2013 20:26:10 +0200 Subject: [PATCH 01/22] fixed: adjusted background_image.html demo CSS to jQuery UI CSS framework changes --- demos/selectmenu/background_image.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/demos/selectmenu/background_image.html b/demos/selectmenu/background_image.html index b3539ebc2fa..39352df5cf8 100644 --- a/demos/selectmenu/background_image.html +++ b/demos/selectmenu/background_image.html @@ -21,11 +21,15 @@ label,select,.ui-select-menu { float: left; margin-right: 10px; } select { width: 250px; } .ui-selectmenu-menu li a, .ui-selectmenu-status { padding: 0.3em 2em; } + + .avatar-big .ui-selectmenu-item-icon, .css-avatar .ui-selectmenu-item-icon , .avatar .ui-selectmenu-item-icon { background-position: 0 0; } /* select with custom icons */ body a.customicons { height: 2.8em;} body .customicons li a, body a.customicons span.ui-selectmenu-status { line-height: 2em; padding-left: 30px !important; } - body .video .ui-selectmenu-item-icon, body .podcast .ui-selectmenu-item-icon, body .rss .ui-selectmenu-item-icon { height: 24px; width: 24px; } + body .video .ui-selectmenu-item-icon, body .podcast .ui-selectmenu-item-icon, body .rss .ui-selectmenu-item-icon { height: 24px; width: 24px; } + body a.video { height: 2.7em; } + body li.video.ui-selectmenu-hasIcon a, body li.podcast.ui-selectmenu-hasIcon a, body li.rss.ui-selectmenu-hasIcon a, body .video .ui-selectmenu-status { padding: 7px 0 7px 30px; } body .video .ui-selectmenu-item-icon { background: url(images/24-video-square.png) 0 0 no-repeat; } body .podcast .ui-selectmenu-item-icon { background: url(images/24-podcast-square.png) 0 0 no-repeat; } body .rss .ui-selectmenu-item-icon { background: url(images/24-rss-square.png) 0 0 no-repeat; } From e65043c3e8ffa8d2ed21ae3f1652294bb51198a8 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Thu, 25 Apr 2013 20:26:28 +0200 Subject: [PATCH 02/22] fixed: TTS --- demos/selectmenu/background_image.html | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/demos/selectmenu/background_image.html b/demos/selectmenu/background_image.html index 39352df5cf8..f2bd79372da 100644 --- a/demos/selectmenu/background_image.html +++ b/demos/selectmenu/background_image.html @@ -3,7 +3,7 @@ Demo Page for jQuery UI selectmenu - + @@ -11,56 +11,56 @@ - + - @@ -130,8 +130,8 @@

Default: "popup" Style with custom icon images

- - + +

"dropdown" Style with custom avatar 16x16 images

@@ -141,7 +141,7 @@

"dropdown" Style with custom avatar 16x16 images

- +

"dropdown" Style with custom avatar 16x16 images as CSS background

@@ -151,7 +151,7 @@

"dropdown" Style with custom avatar 16x16 images as CSS background

- +

"dropdown" Style with custom avatar 50x50 images

From 2fd705cf4049b63bb4940dbbfb268652174782af Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Tue, 28 May 2013 22:22:03 +0200 Subject: [PATCH 03/22] fixed: selectmenu does not close when body is clicked, see https://github.com/fnagel/jquery-ui/issues/293 --- ui/jquery.ui.selectmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 12c676fd5a3..bcf64bd7236 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -159,7 +159,7 @@ $.widget("ui.selectmenu", { // document click closes menu $( document ).bind( "mousedown.selectmenu-" + this.ids[ 0 ], function( event ) { //check if open and if the clicket targes parent is the same - if ( self.isOpen && self.ids[ 1 ] != event.target.offsetParent.id ) { + if ( self.isOpen && !event.target.offsetParent ) { self.close( event ); } }); From b0034316cb8eabbe0f4a1734ae792ada71072ae2 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Tue, 28 May 2013 22:29:49 +0200 Subject: [PATCH 04/22] fixed: issue with dialog widget, thx @ubunoir, see https://github.com/fnagel/jquery-ui/issues/300 --- ui/jquery.ui.selectmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index bcf64bd7236..7b122d19246 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -844,7 +844,7 @@ $.widget("ui.selectmenu", { this.listWrap .removeAttr( 'style' ) - .zIndex( this.element.zIndex() + 1 ) + .zIndex( this.element.zIndex() + 2 ) .position( $.extend( positionDefault, o.positionOptions ) ); } }); From d122a319376559fa32c08b2b2d92608453d793c9 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Tue, 28 May 2013 22:30:21 +0200 Subject: [PATCH 05/22] added: dialog demo file --- demos/selectmenu/dialog.html | 70 ++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 demos/selectmenu/dialog.html diff --git a/demos/selectmenu/dialog.html b/demos/selectmenu/dialog.html new file mode 100644 index 00000000000..6cde9525518 --- /dev/null +++ b/demos/selectmenu/dialog.html @@ -0,0 +1,70 @@ + + + + + Demo Page for jQuery UI selectmenu + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+ + \ No newline at end of file From e6f1e9d0e99c524030066d890b67c1118f3da150 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Wed, 29 May 2013 19:58:50 +0200 Subject: [PATCH 06/22] fixed: follow-up: selectmenu does not close when body is clicked, THX @zalog see https://github.com/fnagel/jquery-ui/issues/293 --- ui/jquery.ui.selectmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 7b122d19246..49f4d2ba3f8 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -159,7 +159,7 @@ $.widget("ui.selectmenu", { // document click closes menu $( document ).bind( "mousedown.selectmenu-" + this.ids[ 0 ], function( event ) { //check if open and if the clicket targes parent is the same - if ( self.isOpen && !event.target.offsetParent ) { + if ( self.isOpen && !$( event.target ).closest( "#" + self.ids[ 1 ] ).length ) { self.close( event ); } }); From 8cc74e5a28d9bb54cb3fa7741586f243b2a881ae Mon Sep 17 00:00:00 2001 From: Jakob Stoeck Date: Wed, 12 Jun 2013 12:38:42 +0300 Subject: [PATCH 07/22] makes scrollbar work with custom scrollbar plugin, fixes #308 --- ui/jquery.ui.selectmenu.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 49f4d2ba3f8..742b71fea9d 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -261,7 +261,12 @@ $.widget("ui.selectmenu", { return true; }) // this allows for using the scrollbar in an overflowed list - .bind( 'mousedown.selectmenu mouseup.selectmenu', function() { return false; }); + .bind( 'mousedown.selectmenu mouseup.selectmenu', function(e) { + // supports custom scroll bar and other plugins which wrap the selectmenu content + if (e.target.hasAttribute('href') && e.target.hash==='#nogo') { + return false; + } + }); // needed when window is resized $( window ).bind( "resize.selectmenu-" + this.ids[ 0 ], $.proxy( self.close, this ) ); From d0b9f01ede6e19daa565aaf7cbef5338498cc726 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Sat, 7 Sep 2013 17:06:32 +0200 Subject: [PATCH 08/22] updated: copyright year --- ui/jquery.ui.selectmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 49f4d2ba3f8..aeb4551474c 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -2,7 +2,7 @@ * jQuery UI Selectmenu version 1.4.0pre * * Copyright (c) 2009-2010 filament group, http://filamentgroup.com - * Copyright (c) 2010-2012 Felix Nagel, http://www.felixnagel.com + * Copyright (c) 2010-2013 Felix Nagel, http://www.felixnagel.com * Licensed under the MIT (MIT-LICENSE.txt) * * https://github.com/fnagel/jquery-ui/wiki/Selectmenu From d9ad9d064d1410eaf16058e217b161e871732955 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Sat, 7 Sep 2013 19:03:49 +0200 Subject: [PATCH 09/22] fixed: enable and disable has been swapped (regression), see #312 --- demos/selectmenu/disable_enable.html | 8 ++++---- ui/jquery.ui.selectmenu.js | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/demos/selectmenu/disable_enable.html b/demos/selectmenu/disable_enable.html index 020296c35f1..1191150bafd 100644 --- a/demos/selectmenu/disable_enable.html +++ b/demos/selectmenu/disable_enable.html @@ -58,10 +58,10 @@ var speedB2 = $('select#speedB2').selectmenu(); $("#optionSwitch").toggle( function(){ - speedB2.selectmenu("enable", 2); + speedB2.selectmenu("disable", 2); }, function(){ - speedB2.selectmenu("disable", 2); + speedB2.selectmenu("enable", 2); } ); @@ -74,10 +74,10 @@ var speedD2 = $('select#speedD2').selectmenu(); $("#optgroupSwitch").toggle( function(){ - speedD2.selectmenu("enable", 1, "optgroup"); + speedD2.selectmenu("disable", 1, "optgroup"); }, function(){ - speedD2.selectmenu("disable", 1, "optgroup"); + speedD2.selectmenu("enable", 1, "optgroup"); } ); diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index aeb4551474c..d5217c09f93 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -747,12 +747,12 @@ $.widget("ui.selectmenu", { var optionElem = this._optionLis.eq( index ); if ( optionElem ) { optionElem - .toggleClass( 'ui-state-disabled', flag ) - .find( "a" ).attr( "aria-disabled", !flag ); + .toggleClass( 'ui-state-disabled', !flag ) + .find( "a" ).attr( "aria-disabled", flag ); if ( flag ) { - this.element.find( "option" ).eq( index ).attr( "disabled", "disabled" ); - } else { this.element.find( "option" ).eq( index ).removeAttr( "disabled" ); + } else { + this.element.find( "option" ).eq( index ).attr( "disabled", "disabled" ); } } }, @@ -762,12 +762,12 @@ $.widget("ui.selectmenu", { var optGroupElem = this.list.find( 'li.ui-selectmenu-group-' + index ); if ( optGroupElem ) { optGroupElem - .toggleClass( 'ui-state-disabled', flag ) - .attr( "aria-disabled", !flag ); + .toggleClass( 'ui-state-disabled', !flag ) + .attr( "aria-disabled", flag ); if ( flag ) { - this.element.find( "optgroup" ).eq( index ).attr( "disabled", "disabled" ); - } else { this.element.find( "optgroup" ).eq( index ).removeAttr( "disabled" ); + } else { + this.element.find( "optgroup" ).eq( index ).attr( "disabled", "disabled" ); } } }, From 1b97e728dcccc23a413ca8059624e0516eda3871 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Sat, 7 Sep 2013 19:12:09 +0200 Subject: [PATCH 10/22] improved: rework enable / enable option setting --- ui/jquery.ui.selectmenu.js | 49 ++++++++++++-------------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index d5217c09f93..e3c8c4d9427 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -718,11 +718,7 @@ $.widget("ui.selectmenu", { if ( typeof( index ) == 'undefined' ) { this._setOption( 'disabled', true ); } else { - if ( type == "optgroup" ) { - this._toggleOptgroup( index, false ); - } else { - this._toggleOption( index, false ); - } + this._toggleEnabled( ( type || "option" ), index, false ); } }, @@ -731,47 +727,32 @@ $.widget("ui.selectmenu", { if ( typeof( index ) == 'undefined' ) { this._setOption( 'disabled', false ); } else { - if ( type == "optgroup" ) { - this._toggleOptgroup( index, true ); - } else { - this._toggleOption( index, true ); - } + this._toggleEnabled( ( type || "option" ), index, true ); } }, _disabled: function( elem ) { return $( elem ).hasClass( 'ui-state-disabled' ); }, - - _toggleOption: function( index, flag ) { - var optionElem = this._optionLis.eq( index ); - if ( optionElem ) { - optionElem - .toggleClass( 'ui-state-disabled', !flag ) - .find( "a" ).attr( "aria-disabled", flag ); + + // true = enabled, false = disabled + _toggleEnabled: function( type, index, flag ) { + var element = this.element.find( type ).eq( index ), + elements = ( type === "optgroup" ) ? this.list.find( 'li.ui-selectmenu-group-' + index ) : this._optionLis.eq( index ); + + if ( elements ) { + elements + .toggleClass( 'ui-state-disabled', !flag ) + .attr( "aria-disabled", flag ); + if ( flag ) { - this.element.find( "option" ).eq( index ).removeAttr( "disabled" ); + element.removeAttr( "disabled" ); } else { - this.element.find( "option" ).eq( index ).attr( "disabled", "disabled" ); + element.attr( "disabled", "disabled" ); } } }, - // true = enabled, false = disabled - _toggleOptgroup: function( index, flag ) { - var optGroupElem = this.list.find( 'li.ui-selectmenu-group-' + index ); - if ( optGroupElem ) { - optGroupElem - .toggleClass( 'ui-state-disabled', !flag ) - .attr( "aria-disabled", flag ); - if ( flag ) { - this.element.find( "optgroup" ).eq( index ).removeAttr( "disabled" ); - } else { - this.element.find( "optgroup" ).eq( index ).attr( "disabled", "disabled" ); - } - } - }, - index: function( newIndex ) { if ( arguments.length ) { if ( !this._disabled( $( this._optionLis[ newIndex ] ) ) && newIndex != this._selectedIndex() ) { From ba36b0a14179b2e7a436064f6a6a64adc5d34c98 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Sat, 7 Sep 2013 19:16:02 +0200 Subject: [PATCH 11/22] improved: rework enable / enable option setting (follow-up) --- ui/jquery.ui.selectmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index e3c8c4d9427..7be7aa9ee24 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -743,7 +743,7 @@ $.widget("ui.selectmenu", { if ( elements ) { elements .toggleClass( 'ui-state-disabled', !flag ) - .attr( "aria-disabled", flag ); + .attr( "aria-disabled", !flag ); if ( flag ) { element.removeAttr( "disabled" ); From 3cfaeacae7f04ed1a5f41ebf011e3eb928bcf53f Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Sat, 7 Sep 2013 19:17:50 +0200 Subject: [PATCH 12/22] fixed: CGL --- ui/jquery.ui.selectmenu.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 7be7aa9ee24..870f27b55c9 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -28,13 +28,13 @@ $.widget("ui.selectmenu", { _create: function() { var self = this, o = this.options; - + // make / set unique id var selectmenuId = this.element.uniqueId().attr( "id" ); // quick array of button and menu id's this.ids = [ selectmenuId, selectmenuId + '-button', selectmenuId + '-menu' ]; - + // define safe mouseup for future toggling this._safemouseup = true; this.isOpen = false; @@ -714,37 +714,37 @@ $.widget("ui.selectmenu", { }, disable: function( index, type ){ - // if options is not provided, call the parents disable function - if ( typeof( index ) == 'undefined' ) { - this._setOption( 'disabled', true ); - } else { - this._toggleEnabled( ( type || "option" ), index, false ); - } + // if options is not provided, call the parents disable function + if ( typeof( index ) == 'undefined' ) { + this._setOption( 'disabled', true ); + } else { + this._toggleEnabled( ( type || "option" ), index, false ); + } }, enable: function( index, type ) { - // if options is not provided, call the parents enable function - if ( typeof( index ) == 'undefined' ) { - this._setOption( 'disabled', false ); - } else { - this._toggleEnabled( ( type || "option" ), index, true ); - } + // if options is not provided, call the parents enable function + if ( typeof( index ) == 'undefined' ) { + this._setOption( 'disabled', false ); + } else { + this._toggleEnabled( ( type || "option" ), index, true ); + } }, _disabled: function( elem ) { - return $( elem ).hasClass( 'ui-state-disabled' ); + return $( elem ).hasClass( 'ui-state-disabled' ); }, - + // true = enabled, false = disabled _toggleEnabled: function( type, index, flag ) { var element = this.element.find( type ).eq( index ), elements = ( type === "optgroup" ) ? this.list.find( 'li.ui-selectmenu-group-' + index ) : this._optionLis.eq( index ); - + if ( elements ) { elements .toggleClass( 'ui-state-disabled', !flag ) .attr( "aria-disabled", !flag ); - + if ( flag ) { element.removeAttr( "disabled" ); } else { From 66fd8ec68bb0e072d313f9bd4906631b25689ad7 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Sat, 7 Sep 2013 19:23:31 +0200 Subject: [PATCH 13/22] fixed: disabled select is tab-able, see #301 --- ui/jquery.ui.selectmenu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 870f27b55c9..029afce0ffe 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -703,13 +703,13 @@ $.widget("ui.selectmenu", { _setOption: function( key, value ) { this.options[ key ] = value; - // set if ( key == 'disabled' ) { if ( value ) this.close(); this.element .add( this.newelement ) .add( this.list )[ value ? 'addClass' : 'removeClass' ]( 'ui-selectmenu-disabled ' + 'ui-state-disabled' ) - .attr( "aria-disabled" , value ); + .attr( "aria-disabled" , value ) + .attr( "tabindex" , value ? 1 : 0 ); } }, From 4729232f4d594d0385430d8f9284154d942add5b Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Mon, 16 Sep 2013 22:22:26 +0200 Subject: [PATCH 14/22] fixed: wrong property value on aria-disabled when option is disabled by HTML --- ui/jquery.ui.selectmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 029afce0ffe..1f7db15b931 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -307,7 +307,7 @@ $.widget("ui.selectmenu", { 'aria-selected' : false }; if ( selectOptionData[ i ].disabled ) { - thisAAttr[ 'aria-disabled' ] = selectOptionData[ i ].disabled; + thisAAttr[ 'aria-disabled' ] = true; } if ( selectOptionData[ i ].typeahead ) { thisAAttr[ 'typeahead' ] = selectOptionData[ i ].typeahead; From 98cf5eec4fa4635e0f9c1574f756a9b34770eabe Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Mon, 14 Oct 2013 00:35:24 +0200 Subject: [PATCH 15/22] Release version 1.4.0 (jQuery 1.8.3 / UI 1.9.2) --- readme | 3 ++- ui/jquery.ui.selectmenu.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/readme b/readme index 9dd7a0d6403..bc93b1d8616 100644 --- a/readme +++ b/readme @@ -10,7 +10,8 @@ http://filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_ DOWNLOAD Latest: https://github.com/fnagel/jquery-ui/zipball/selectmenu (jQuery 1.8.x / UI 1.9.x) -Current stable: https://github.com/fnagel/jquery-ui/zipball/selectmenu_v1.3.0 (jQuery 1.8.2 / UI 1.8.24) +Current stable: https://github.com/fnagel/jquery-ui/zipball/selectmenu_v1.4.0 (jQuery 1.8.3 / UI 1.9.2) +Old stable: https://github.com/fnagel/jquery-ui/zipball/selectmenu_v1.3.0 (jQuery 1.8.2 / UI 1.8.24) Old stable: https://github.com/fnagel/jquery-ui/zipball/selectmenu_v1.2.2 (jQuery 1.7.2 / UI 1.8.20) Old stable: https://github.com/fnagel/jquery-ui/zipball/selectmenu_v1.2.1 (jQuery 1.6.4 / UI 1.8.17) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 1f7db15b931..ef906ee4d89 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -1,5 +1,5 @@ /* - * jQuery UI Selectmenu version 1.4.0pre + * jQuery UI Selectmenu version 1.4.0 * * Copyright (c) 2009-2010 filament group, http://filamentgroup.com * Copyright (c) 2010-2013 Felix Nagel, http://www.felixnagel.com From 1a9d0bce9fed921b08860119e02aa1eff0dc20ae Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Mon, 14 Oct 2013 00:37:16 +0200 Subject: [PATCH 16/22] set version to 1.5.0pre --- ui/jquery.ui.selectmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index ef906ee4d89..0ad6598b17c 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -1,5 +1,5 @@ /* - * jQuery UI Selectmenu version 1.4.0 + * jQuery UI Selectmenu version 1.5.0pre * * Copyright (c) 2009-2010 filament group, http://filamentgroup.com * Copyright (c) 2010-2013 Felix Nagel, http://www.felixnagel.com From 5034d5e2799b437b857c998b7e05c51fbe8984d1 Mon Sep 17 00:00:00 2001 From: wuSam Date: Fri, 25 Oct 2013 10:34:34 +0200 Subject: [PATCH 17/22] remove blank causing a jqmigrate warning remove blank causing a jqmigrate warning --- ui/jquery.ui.selectmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 04e6e1b1baf..6f26168bade 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -393,7 +393,7 @@ $.widget("ui.selectmenu", { } } } else { - $('
  • ' ).appendTo( this.list ); + $('
  • ' ).appendTo( this.list ); } // we need to set and unset the CSS classes for dropdown and popup style var isDropDown = ( o.style == 'dropdown' ); From 32689789772a74b90f92b712d205745b1a2eb1d2 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Thu, 7 Nov 2013 23:40:48 +0100 Subject: [PATCH 18/22] Revert "makes scrollbar work with custom scrollbar plugin, fixes #308" This reverts commit 8cc74e5a28d9bb54cb3fa7741586f243b2a881ae. --- ui/jquery.ui.selectmenu.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 6f26168bade..43944ce907a 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -261,12 +261,7 @@ $.widget("ui.selectmenu", { return true; }) // this allows for using the scrollbar in an overflowed list - .bind( 'mousedown.selectmenu mouseup.selectmenu', function(e) { - // supports custom scroll bar and other plugins which wrap the selectmenu content - if (e.target.hasAttribute('href') && e.target.hash==='#nogo') { - return false; - } - }); + .bind( 'mousedown.selectmenu mouseup.selectmenu', function() { return false; }); // needed when window is resized $( window ).bind( "resize.selectmenu-" + this.ids[ 0 ], $.proxy( self.close, this ) ); From 7011574ee0ba61f2ceb4184e9bd37fc87eb8609f Mon Sep 17 00:00:00 2001 From: Bruce Lewis Date: Mon, 2 Dec 2013 10:32:54 -0500 Subject: [PATCH 19/22] Leave height as auto for Android 2 where internal divs don't scroll --- ui/jquery.ui.selectmenu.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 43944ce907a..773d49f88fc 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -414,13 +414,15 @@ $.widget("ui.selectmenu", { this.list.width( o.menuWidth ? o.menuWidth : o.width - o.handleWidth ); } - // reset height to auto - this.list.css( 'height', 'auto' ); - var listH = this.listWrap.height(); - var winH = $( window ).height(); - // calculate default max height - var maxH = o.maxHeight ? Math.min( o.maxHeight, winH ) : winH / 3; - if ( listH > maxH ) this.list.height( maxH ); + // Android 2 (Gingerbread) doesn't support internal scrollable divs. + // Don't limit the menu height for that browser. + if ( !navigator.userAgent.match( /Android 2/ ) ) { + var listH = this.listWrap.height(); + var winH = $( window ).height(); + // calculate default max height + var maxH = o.maxHeight ? Math.min( o.maxHeight, winH ) : winH / 3; + if ( listH > maxH ) this.list.height( maxH ); + } // save reference to actionable li's (not group label li's) this._optionLis = this.list.find( 'li:not(.ui-selectmenu-group)' ); From ff04ae42dd639f44696e80cab80623aaad1a1113 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Sun, 1 Jun 2014 14:37:37 +0200 Subject: [PATCH 20/22] fixed: issue with typeahead when items start with same letters, thx @deansimcox, see #337 --- ui/jquery.ui.selectmenu.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 773d49f88fc..a51755b002c 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -509,6 +509,7 @@ $.widget("ui.selectmenu", { } } else { nextIndex = i; + break; } } } From 9f9f61858ce4e62006dbea17aca446471f271a26 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Tue, 3 Jun 2014 18:26:42 +0200 Subject: [PATCH 21/22] fixed: prevent mouseover highlighting of list item if typeahead is used, see #332 --- ui/jquery.ui.selectmenu.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index a51755b002c..ef2cde22a0d 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -336,13 +336,15 @@ $.widget("ui.selectmenu", { return false; }) .bind('mouseover.selectmenu', function( e ) { - // no hover if diabled + // no hover if disabled if ( !$( this ).hasClass( 'ui-state-disabled' ) && !$( this ).parent( "ul" ).parent( "li" ).hasClass( 'ui-state-disabled' ) ) { - e.optionValue = self.element[ 0 ].options[ $( this ).data( 'index' ) ].value; - self._trigger( "hover", e, self._uiHash() ); - self._selectedOptionLi().addClass( activeClass ); - self._focusedOptionLi().removeClass( 'ui-selectmenu-item-focus ui-state-hover' ); - $( this ).removeClass( 'ui-state-active' ).addClass( 'ui-selectmenu-item-focus ui-state-hover' ); + if ( self._typeAhead_timer === undefined ) { + e.optionValue = self.element[ 0 ].options[ $( this ).data( 'index' ) ].value; + self._trigger( "hover", e, self._uiHash() ); + self._selectedOptionLi().addClass( activeClass ); + self._focusedOptionLi().removeClass( 'ui-selectmenu-item-focus ui-state-hover' ); + $( this ).removeClass( 'ui-state-active' ).addClass( 'ui-selectmenu-item-focus ui-state-hover' ); + } } }) .bind( 'mouseout.selectmenu', function( e ) { From 36b6a3f1e5e229538021896ee26b0125a4cf0d09 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Wed, 4 Jun 2014 12:31:07 +0200 Subject: [PATCH 22/22] updated: copyright year --- ui/jquery.ui.selectmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index ef2cde22a0d..52e965e0dba 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -2,7 +2,7 @@ * jQuery UI Selectmenu version 1.5.0pre * * Copyright (c) 2009-2010 filament group, http://filamentgroup.com - * Copyright (c) 2010-2013 Felix Nagel, http://www.felixnagel.com + * Copyright (c) 2010-2014 Felix Nagel, http://www.felixnagel.com * Licensed under the MIT (MIT-LICENSE.txt) * * https://github.com/fnagel/jquery-ui/wiki/Selectmenu