/*!
- * OOjs UI v0.18.0
+ * OOjs UI v0.18.4-fix (d4045dee45)
* https://www.mediawiki.org/wiki/OOjs_UI
*
- * Copyright 2011–2016 OOjs UI Team and other contributors.
+ * Copyright 2011–2017 OOjs UI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2016-11-09T00:52:37Z
+ * Date: 2017-01-19T20:22:26Z
*/
( function ( OO ) {
* @constructor
* @param {Object} [config] Configuration options
* @cfg {boolean} [continuous=false] Show all pages, one after another
- * @cfg {boolean} [autoFocus=true] Focus on the first focusable element when a new page is displayed.
+ * @cfg {boolean} [autoFocus=true] Focus on the first focusable element when a new page is displayed. Disabled on mobile.
* @cfg {boolean} [outlined=false] Show the outline. The outline is used to navigate through the pages of the booklet.
* @cfg {boolean} [editable=false] Show controls for adding, removing and reordering pages
*/
if ( !this.scrolling && page ) {
page.scrollElementIntoView( {
complete: function () {
- if ( layout.autoFocus ) {
+ if ( layout.autoFocus && !OO.ui.isMobile() ) {
layout.focus();
}
}
// meaningless because the next page is not visible yet and thus can't hold focus.
if (
this.autoFocus &&
+ !OO.ui.isMobile() &&
this.stackLayout.continuous &&
OO.ui.findFocusable( page.$element ).length !== 0
) {
* @param {Object} [config] Configuration options
* @cfg {boolean} [continuous=false] Show all cards, one after another
* @cfg {boolean} [expanded=true] Expand the content panel to fill the entire parent element.
- * @cfg {boolean} [autoFocus=true] Focus on the first focusable element when a new card is displayed.
+ * @cfg {boolean} [autoFocus=true] Focus on the first focusable element when a new card is displayed. Disabled on mobile.
*/
OO.ui.IndexLayout = function OoUiIndexLayout( config ) {
// Configuration initialization
if ( card ) {
card.scrollElementIntoView( {
complete: function () {
- if ( layout.autoFocus ) {
+ if ( layout.autoFocus && !OO.ui.isMobile() ) {
layout.focus();
}
}
// meaningless because the next card is not visible yet and thus can't hold focus.
if (
this.autoFocus &&
+ !OO.ui.isMobile() &&
this.stackLayout.continuous &&
OO.ui.findFocusable( card.$element ).length !== 0
) {
* @param {Object} [config] Configuration options
* @cfg {string} [placeholder] Placeholder text
* @cfg {boolean} [allowArbitrary=false] Allow data items to be added even if not present in the menu.
+ * @cfg {boolean} [allowDuplicates=false] Allow duplicate items to be added.
* @cfg {Object} [menu] (required) Configuration options to pass to the
* {@link OO.ui.MenuSelectWidget menu select widget}.
* @cfg {Object} [popup] Configuration options to pass to the {@link OO.ui.PopupWidget popup widget}.
// Configuration initialization
config = $.extend( {
allowArbitrary: false,
+ allowDuplicates: false,
$overlay: this.$element
}, config );
// Properties
this.$content = $( '<div>' );
this.allowArbitrary = config.allowArbitrary;
+ this.allowDuplicates = config.allowDuplicates;
this.$overlay = config.$overlay;
this.menu = new OO.ui.FloatingMenuSelectWidget( $.extend(
{
// Events
if ( this.popup ) {
$tabFocus.on( {
- focus: this.onFocusForPopup.bind( this )
+ focus: this.focus.bind( this )
} );
this.popup.$element.on( 'focusout', this.onPopupFocusOut.bind( this ) );
if ( this.popup.$autoCloseIgnore ) {
$.each( datas, function ( i, data ) {
var item;
- if ( !widget.getItemFromData( data ) ) {
+ if ( !widget.getItemFromData( data ) || widget.allowDuplicates ) {
item = menu.getItemFromData( data );
if ( item ) {
item = widget.createItemWidget( data, item.label );
this.clearInput();
};
-/**
- * Handle focus events
- *
- * @private
- * @param {jQuery.Event} event
- */
-OO.ui.CapsuleMultiselectWidget.prototype.onFocusForPopup = function () {
- if ( !this.isDisabled() ) {
- this.popup.setSize( this.$handle.width() );
- this.popup.toggle( true );
- OO.ui.findFocusable( this.popup.$element ).focus();
- }
-};
-
/**
* Handles popup focus out events.
*
setTimeout( function () {
if (
widget.isVisible() &&
- !OO.ui.contains( widget.$element[ 0 ], document.activeElement, true ) &&
- ( !widget.$autoCloseIgnore || !widget.$autoCloseIgnore.has( document.activeElement ).length )
+ !OO.ui.contains( widget.$element.add( widget.$autoCloseIgnore ).get(), document.activeElement, true )
) {
widget.toggle( false );
}
};
/**
+ * The old name for the CapsuleMultiselectWidget widget, provided for backwards-compatibility.
+ *
* @class
+ * @extends OO.ui.CapsuleMultiselectWidget
+ *
+ * @constructor
* @deprecated since 0.17.3; use OO.ui.CapsuleMultiselectWidget instead
*/
-OO.ui.CapsuleMultiSelectWidget = OO.ui.CapsuleMultiselectWidget;
+OO.ui.CapsuleMultiSelectWidget = function OoUiCapsuleMultiSelectWidget() {
+ OO.ui.warnDeprecation( 'CapsuleMultiSelectWidget is deprecated. Use the CapsuleMultiselectWidget instead.' );
+ // Parent constructor
+ OO.ui.CapsuleMultiSelectWidget.parent.apply( this, arguments );
+};
+
+OO.inheritClass( OO.ui.CapsuleMultiSelectWidget, OO.ui.CapsuleMultiselectWidget );
/**
* SelectFileWidgets allow for selecting files, using the HTML5 File API. These
return false;
}
- /* eslint-disable no-bitwise */
- if ( this.isInteger && ( n | 0 ) !== n ) {
+ if ( this.isInteger && Math.floor( n ) !== n ) {
return false;
}
- /* eslint-enable no-bitwise */
if ( n < this.min || n > this.max ) {
return false;
};
}( OO ) );
+
+//# sourceMappingURL=oojs-ui-widgets.js.map
\ No newline at end of file