X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Flib%2Foojs-ui%2Foojs-ui-core.js;h=20c58ff42a21b39cc5c507251cdcbdb4fd7d740c;hb=6f6e7d6dfd5b4c5cdb4f1e4f80be77dd8ad71b57;hp=082b7eca3f7f0c03030ef38b8d2394091611d021;hpb=fe77ef31d5d6d2dd57a66f16d015e395014fb23c;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/lib/oojs-ui/oojs-ui-core.js b/resources/lib/oojs-ui/oojs-ui-core.js index 082b7eca3f..20c58ff42a 100644 --- a/resources/lib/oojs-ui/oojs-ui-core.js +++ b/resources/lib/oojs-ui/oojs-ui-core.js @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.24.0 + * OOjs UI v0.24.2 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2017 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2017-10-17T23:18:51Z + * Date: 2017-11-07T22:52:40Z */ ( function ( OO ) { @@ -7555,7 +7555,7 @@ OO.ui.DropdownWidget.prototype.onMenuSelect = function ( item ) { * Handle menu toggle events. * * @private - * @param {boolean} isVisible Menu toggle event + * @param {boolean} isVisible Open state of the menu */ OO.ui.DropdownWidget.prototype.onMenuToggle = function ( isVisible ) { this.$element.toggleClass( 'oo-ui-dropdownWidget-open', isVisible ); @@ -7589,10 +7589,15 @@ OO.ui.DropdownWidget.prototype.onKeyDown = function ( e ) { !this.isDisabled() && ( e.which === OO.ui.Keys.ENTER || + ( + e.which === OO.ui.Keys.SPACE && + // Avoid conflicts with type-to-search, see SelectWidget#onKeyPress. + // Space only closes the menu is the user is not typing to search. + this.menu.keyPressBuffer === '' + ) || ( !this.menu.isVisible() && ( - e.which === OO.ui.Keys.SPACE || e.which === OO.ui.Keys.UP || e.which === OO.ui.Keys.DOWN ) @@ -10679,7 +10684,8 @@ OO.ui.ComboBoxInputWidget = function OoUiComboBoxInputWidget( config ) { this.menu.connect( this, { choose: 'onMenuChoose', add: 'onMenuItemsChange', - remove: 'onMenuItemsChange' + remove: 'onMenuItemsChange', + toggle: 'onMenuToggle' } ); // Initialization @@ -10790,6 +10796,16 @@ OO.ui.ComboBoxInputWidget.prototype.onMenuItemsChange = function () { this.$element.toggleClass( 'oo-ui-comboBoxInputWidget-empty', this.menu.isEmpty() ); }; +/** + * Handle menu toggle events. + * + * @private + * @param {boolean} isVisible Open state of the menu + */ +OO.ui.ComboBoxInputWidget.prototype.onMenuToggle = function ( isVisible ) { + this.$element.toggleClass( 'oo-ui-comboBoxInputWidget-open', isVisible ); +}; + /** * @inheritdoc */