Update OOUI to v0.33.4
[lhc/web/wiklou.git] / resources / lib / ooui / oojs-ui-widgets.js
index ede14be..1f5ca65 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOUI v0.33.0
+ * OOUI v0.33.4
  * https://www.mediawiki.org/wiki/OOUI
  *
  * Copyright 2011–2019 OOUI Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2019-06-27T03:27:26Z
+ * Date: 2019-07-23T03:23:32Z
  */
 ( function ( OO ) {
 
@@ -3799,6 +3799,40 @@ OO.inheritClass( OO.ui.TabOptionWidget, OO.ui.OptionWidget );
  */
 OO.ui.TabOptionWidget.static.highlightable = false;
 
+/**
+ * @static
+ * @inheritdoc
+ */
+OO.ui.TabOptionWidget.static.scrollIntoViewOnSelect = true;
+
+/**
+ * Center tab horizontally after selecting on mobile
+ *
+ * @param {Object} [config] Configuration options
+ * @return {jQuery.Promise} Promise which resolves when the scroll is complete
+ */
+OO.ui.TabOptionWidget.prototype.scrollElementIntoView = function ( config ) {
+       var padding;
+       if ( !OO.ui.isMobile() || !this.getElementGroup() ) {
+               // Parent method
+               return OO.ui.TabOptionWidget.super.prototype.scrollElementIntoView.call( this );
+       } else {
+               padding = Math.max( (
+                       this.getElementGroup().$element[ 0 ].clientWidth - this.$element[ 0 ].clientWidth
+               ) / 2, 0 );
+               // Parent method
+               return OO.ui.TabOptionWidget.super.prototype.scrollElementIntoView.call( this, $.extend(
+                       {
+                               padding: {
+                                       left: padding,
+                                       right: padding
+                               }
+                       },
+                       config
+               ) );
+       }
+};
+
 /**
  * TabSelectWidget is a list that contains {@link OO.ui.TabOptionWidget tab options}
  *
@@ -4502,7 +4536,7 @@ OO.ui.TagMultiselectWidget.prototype.doInputEnter = function () {
 };
 
 /**
- * Perform an action responding to the Enter key on the input
+ * Perform an action responding to the Backspace key on the input
  *
  * @param {jQuery.Event} e Event data
  * @param {boolean} [withMetaKey] Whether this key was pressed with