Merge "Title: Use a more proper way of detecting whether interwikis are local"
[lhc/web/wiklou.git] / resources / lib / oojs-ui / oojs-ui-widgets.js
index b4c4655..058cd95 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.23.2
+ * OOjs UI v0.24.3
  * 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-09-26T20:18:42Z
+ * Date: 2017-11-28T23:28:05Z
  */
 ( function ( OO ) {
 
@@ -279,7 +279,6 @@ OO.ui.mixin.DraggableGroupElement = function OoUiMixinDraggableGroupElement( con
        }
        this.$element
                .addClass( 'oo-ui-draggableGroupElement' )
-               .append( this.$status )
                .toggleClass( 'oo-ui-draggableGroupElement-horizontal', this.orientation === 'horizontal' );
 };
 
@@ -1883,12 +1882,21 @@ OO.ui.BookletLayout.prototype.onStackLayoutVisibleItemChange = function ( page )
  * @param {OO.ui.PanelLayout|null} page The page panel that is now the current panel
  */
 OO.ui.BookletLayout.prototype.onStackLayoutSet = function ( page ) {
-       var layout = this;
-       if ( !this.scrolling && page ) {
-               page.scrollElementIntoView().done( function () {
-                       if ( layout.autoFocus && !OO.ui.isMobile() ) {
-                               layout.focus();
-                       }
+       var promise, layout = this;
+       // If everything is unselected, do nothing
+       if ( !page ) {
+               return;
+       }
+       // For continuous BookletLayouts, scroll the selected page into view first
+       if ( this.stackLayout.continuous && !this.scrolling ) {
+               promise = page.scrollElementIntoView();
+       } else {
+               promise = $.Deferred().resolve();
+       }
+       // Focus the first element on the newly selected panel
+       if ( this.autoFocus && !OO.ui.isMobile() ) {
+               promise.done( function () {
+                       layout.focus();
                } );
        }
 };
@@ -2415,13 +2423,13 @@ OO.ui.IndexLayout.prototype.onStackLayoutFocus = function ( e ) {
  * @param {OO.ui.PanelLayout|null} tabPanel The tab panel that is now the current panel
  */
 OO.ui.IndexLayout.prototype.onStackLayoutSet = function ( tabPanel ) {
-       var layout = this;
-       if ( tabPanel ) {
-               tabPanel.scrollElementIntoView().done( function () {
-                       if ( layout.autoFocus && !OO.ui.isMobile() ) {
-                               layout.focus();
-                       }
-               );
+       // If everything is unselected, do nothing
+       if ( !tabPanel ) {
+               return;
+       }
+       // Focus the first element on the newly selected panel
+       if ( this.autoFocus && !OO.ui.isMobile() ) {
+               this.focus();
        }
 };
 
@@ -4433,7 +4441,7 @@ OO.ui.CapsuleMultiselectWidget.prototype.onMenuChoose = function ( item ) {
  * Handle menu toggle events.
  *
  * @private
- * @param {boolean} isVisible Menu toggle event
+ * @param {boolean} isVisible Open state of the menu
  */
 OO.ui.CapsuleMultiselectWidget.prototype.onMenuToggle = function ( isVisible ) {
        this.$element.toggleClass( 'oo-ui-capsuleMultiselectWidget-open', isVisible );