/*!
- * OOUI v0.29.6
+ * OOUI v0.30.0
* https://www.mediawiki.org/wiki/OOUI
*
* Copyright 2011–2018 OOUI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2018-12-05T00:15:55Z
+ * Date: 2018-12-20T06:10:28Z
*/
( function ( OO ) {
'ooui-dialog-process-retry': 'Try again',
// Label for process dialog retry action button, visible when describing only warnings
'ooui-dialog-process-continue': 'Continue',
+ // Label for button in combobox input that triggers its dropdown
+ 'ooui-combobox-button-label': 'Dropdown for combobox',
// Label for the file selection widget's select file button
'ooui-selectfile-button-select': 'Select a file',
// Label for the file selection widget if file selection is not supported
*/
OO.ui.Element.static.infuse = function ( idOrNode, config ) {
var obj = OO.ui.Element.static.unsafeInfuse( idOrNode, config, false );
+
+ if ( typeof idOrNode === 'string' ) {
+ // IDs deprecated since 0.29.7
+ OO.ui.warnDeprecation(
+ 'Passing a string ID to infuse is deprecated. Use an HTMLElement or jQuery collection instead.'
+ );
+ }
// Verify that the type matches up.
// FIXME: uncomment after T89721 is fixed, see T90929.
/*
var rtlScrollType = null;
function test() {
- var $definer = $( '<div dir="rtl" style="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll">A</div>' ),
+ var $definer = $( '<div>' ).attr( {
+ dir: 'rtl',
+ style: 'font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;'
+ } ).text( 'A' ),
definer = $definer[ 0 ];
$definer.appendTo( 'body' );
* label: 'plaintext label'
* } );
* var label2 = new OO.ui.LabelWidget( {
- * label: $( '<a href="default.html">jQuery label</a>' )
+ * label: $( '<a>' ).attr( 'href', 'default.html' ).text( 'jQuery label' )
* } );
* // Create a fieldset layout with fields for each example
* var fieldset = new OO.ui.FieldsetLayout();
OO.ui.DropdownWidget.parent.call( this, config );
// Properties (must be set before TabIndexedElement constructor call)
- this.$handle = $( '<span>' );
+ this.$handle = $( '<button>' );
this.$overlay = ( config.$overlay === true ? OO.ui.getDefaultOverlay() : config.$overlay ) || this.$element;
// Mixin constructors
this.$handle
.addClass( 'oo-ui-dropdownWidget-handle' )
.attr( {
- role: 'combobox',
'aria-owns': this.menu.getElementId(),
- 'aria-autocomplete': 'list'
+ 'aria-haspopup': 'listbox'
} )
.append( this.$icon, this.$label, this.$indicator );
this.$element
*
* @class
* @extends OO.ui.InputWidget
+ * @mixins OO.ui.mixin.TitledElement
*
* @constructor
* @param {Object} [config] Configuration options
// Use this instead of setOptions() because this.$input is not set up yet.
this.setOptionsData( config.options || [] );
+ // Mixin constructors
+ OO.ui.mixin.TitledElement.call( this, $.extend( {}, config, { $titled: this.dropdownWidget.$handle } ) );
+
// Parent constructor
OO.ui.DropdownInputWidget.parent.call( this, config );
/* Setup */
OO.inheritClass( OO.ui.DropdownInputWidget, OO.ui.InputWidget );
+OO.mixinClass( OO.ui.DropdownInputWidget, OO.ui.mixin.TitledElement );
/* Methods */
this.$overlay = ( config.$overlay === true ? OO.ui.getDefaultOverlay() : config.$overlay ) || this.$element;
this.dropdownButton = new OO.ui.ButtonWidget( {
classes: [ 'oo-ui-comboBoxInputWidget-dropdownButton' ],
+ label: OO.ui.msg( 'ooui-combobox-button-label' ),
indicator: 'down',
+ invisibleLabel: true,
disabled: this.disabled
} );
this.menu = new OO.ui.MenuSelectWidget( $.extend(
// Initialization
this.$input.attr( {
role: 'combobox',
+ 'aria-expanded': 'false',
'aria-owns': this.menu.getElementId(),
'aria-autocomplete': 'list'
} );
+ this.dropdownButton.$button.attr( {
+ 'aria-controls': this.menu.getElementId()
+ } );
// Do not override options set via config.menu.items
if ( config.options !== undefined ) {
this.setOptions( config.options );