Merge "RCFilters: Only normalize title with 'target' when it is needed"
[lhc/web/wiklou.git] / resources / lib / oojs-ui / oojs-ui-toolbars.js
index c98f585..59d6474 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.23.5
+ * OOjs UI v0.25.0
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
- * Copyright 2011–2017 OOjs UI Team and other contributors.
+ * Copyright 2011–2018 OOjs UI Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2017-10-12T21:25:50Z
+ * Date: 2018-01-10T00:26:02Z
  */
 ( function ( OO ) {
 
@@ -1857,6 +1857,33 @@ OO.mixinClass( OO.ui.PopupToolGroup, OO.ui.mixin.TabIndexedElement );
 
 /* Methods */
 
+/**
+ * @inheritdoc OO.ui.mixin.ClippableElement
+ */
+OO.ui.PopupToolGroup.prototype.getHorizontalAnchorEdge = function () {
+       var out;
+       if ( this.$element.hasClass( 'oo-ui-popupToolGroup-right' ) ) {
+               out = 'right';
+       } else {
+               out = 'left';
+       }
+       // Flip for RTL
+       if ( this.$element.css( 'direction' ) === 'rtl' ) {
+               out = ( out === 'left' ) ? 'right' : 'left';
+       }
+       return out;
+};
+
+/**
+ * @inheritdoc OO.ui.mixin.ClippableElement
+ */
+OO.ui.PopupToolGroup.prototype.getVerticalAnchorEdge = function () {
+       if ( this.toolbar.position === 'bottom' ) {
+               return 'bottom';
+       }
+       return 'top';
+};
+
 /**
  * @inheritdoc
  */
@@ -1951,7 +1978,7 @@ OO.ui.PopupToolGroup.prototype.setActive = function ( value ) {
                        this.$element.addClass( 'oo-ui-popupToolGroup-active oo-ui-popupToolGroup-left' );
                        this.setFlags( { progressive: true } );
                        this.toggleClipping( true );
-                       if ( this.isClippedHorizontally() ) {
+                       if ( this.isClippedHorizontally() || this.isFloatableOutOfView() ) {
                                // Anchoring to the left caused the popup to clip, so anchor it to the right instead
                                this.toggleClipping( false );
                                this.$element
@@ -1959,7 +1986,7 @@ OO.ui.PopupToolGroup.prototype.setActive = function ( value ) {
                                        .addClass( 'oo-ui-popupToolGroup-right' );
                                this.toggleClipping( true );
                        }
-                       if ( this.isClippedHorizontally() ) {
+                       if ( this.isClippedHorizontally() || this.isFloatableOutOfView() ) {
                                // Anchoring to the right also caused the popup to clip, so just make it fill the container
                                containerWidth = this.$clippableScrollableContainer.width();
                                containerLeft = this.$clippableScrollableContainer[ 0 ] === document.documentElement ?