diff options
Diffstat (limited to 'wp-includes/js/jquery/ui/selectmenu.js')
-rw-r--r-- | wp-includes/js/jquery/ui/selectmenu.js | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/wp-includes/js/jquery/ui/selectmenu.js b/wp-includes/js/jquery/ui/selectmenu.js index 4da4f81..f6540bb 100644 --- a/wp-includes/js/jquery/ui/selectmenu.js +++ b/wp-includes/js/jquery/ui/selectmenu.js @@ -1,10 +1,10 @@ /*! - * jQuery UI Selectmenu 1.13.2 - * http://jqueryui.com + * jQuery UI Selectmenu 1.13.3 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license */ //>>label: Selectmenu @@ -12,8 +12,8 @@ /* eslint-disable max-len */ //>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select. /* eslint-enable max-len */ -//>>docs: http://api.jqueryui.com/selectmenu/ -//>>demos: http://jqueryui.com/selectmenu/ +//>>docs: https://api.jqueryui.com/selectmenu/ +//>>demos: https://jqueryui.com/selectmenu/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css //>>css.theme: ../../themes/base/theme.css @@ -27,7 +27,13 @@ define( [ "jquery", "./menu", - "./core" + "../form-reset-mixin", + "../keycode", + "../labels", + "../position", + "../unique-id", + "../version", + "../widget" ], factory ); } else { @@ -38,7 +44,7 @@ "use strict"; return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { - version: "1.13.2", + version: "1.13.3", defaultElement: "<select>", options: { appendTo: null, @@ -348,7 +354,12 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { if ( item.disabled ) { this._addClass( li, null, "ui-state-disabled" ); } - this._setText( wrapper, item.label ); + + if ( item.hidden ) { + li.prop( "hidden", true ); + } else { + this._setText( wrapper, item.label ); + } return li.append( wrapper ).appendTo( ul ); }, @@ -652,10 +663,6 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { var that = this, data = []; options.each( function( index, item ) { - if ( item.hidden ) { - return; - } - data.push( that._parseOption( $( item ), index ) ); } ); this.items = data; @@ -669,6 +676,7 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { index: index, value: option.val(), label: option.text(), + hidden: optgroup.prop( "hidden" ) || option.prop( "hidden" ), optgroup: optgroup.attr( "label" ) || "", disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" ) }; |