Merge "Add block and unblock commands to WDIO"
[lhc/web/wiklou.git] / resources / lib / ooui / oojs-ui-windows.js
index 0918473..f86aee1 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOUI v0.29.6
+ * OOUI v0.30.2
  * https://www.mediawiki.org/wiki/OOUI
  *
- * Copyright 2011–2018 OOUI Team and other contributors.
+ * Copyright 2011–2019 OOUI Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2018-12-05T00:15:55Z
+ * Date: 2019-01-23T01:14:20Z
  */
 ( function ( OO ) {
 
@@ -159,7 +159,7 @@ OO.ui.ActionWidget.prototype.getModes = function () {
  *         return this.panel1.$element.outerHeight( true );
  *     };
  *     var windowManager = new OO.ui.WindowManager();
- *     $( 'body' ).append( windowManager.$element );
+ *     $( document.body ).append( windowManager.$element );
  *     var dialog = new MyProcessDialog( {
  *         size: 'medium'
  *     } );
@@ -1536,7 +1536,7 @@ OO.ui.WindowManager.prototype.closeWindow = function ( win, data ) {
  * Example:
  *
  *     var windowManager = new OO.ui.WindowManager();
- *     $( 'body' ).append( windowManager.$element );
+ *     $( document.body ).append( windowManager.$element );
  *
  *     // Add a window under the default name: see OO.ui.MessageDialog.static.name
  *     windowManager.addWindows( [ new OO.ui.MessageDialog() ] );
@@ -1680,11 +1680,8 @@ OO.ui.WindowManager.prototype.toggleGlobalEvents = function ( on ) {
                        if ( stackDepth === 0 ) {
                                scrollWidth = window.innerWidth - document.documentElement.clientWidth;
                                bodyMargin = parseFloat( $body.css( 'margin-right' ) ) || 0;
-                               $body.css( {
-                                       overflow: 'hidden',
-                                       position: 'relative',
-                                       'margin-right': bodyMargin + scrollWidth
-                               } );
+                               $body.addClass( 'oo-ui-windowManager-modal-active' );
+                               $body.css( 'margin-right', bodyMargin + scrollWidth );
                        }
                        stackDepth++;
                        this.globalEvents = true;
@@ -1696,11 +1693,8 @@ OO.ui.WindowManager.prototype.toggleGlobalEvents = function ( on ) {
                } );
                stackDepth--;
                if ( stackDepth === 0 ) {
-                       $body.css( {
-                               overflow: '',
-                               position: '',
-                               'margin-right': ''
-                       } );
+                       $body.removeClass( 'oo-ui-windowManager-modal-active' );
+                       $body.css( 'margin-right', '' );
                }
                this.globalEvents = false;
        }
@@ -1732,7 +1726,7 @@ OO.ui.WindowManager.prototype.toggleAriaIsolation = function ( isolate ) {
                        this.$element.removeAttr( 'aria-hidden' );
 
                        // Hide everything other than the window manager from screen readers
-                       this.$ariaHidden = $( 'body' )
+                       this.$ariaHidden = $( document.body )
                                .children()
                                .not( 'script' )
                                .not( $topLevelElement )
@@ -2427,6 +2421,7 @@ OO.ui.Window.prototype.hold = function ( data ) {
 
                // Blur the focused element
                if ( $focus.length ) {
+                       // eslint-disable-next-line jquery/no-event-shorthand
                        $focus[ 0 ].blur();
                }
 
@@ -2485,7 +2480,7 @@ OO.ui.Window.prototype.teardown = function ( data ) {
  *     } );
  *     // Create and append a window manager, which opens and closes the window.
  *     var windowManager = new OO.ui.WindowManager();
- *     $( 'body' ).append( windowManager.$element );
+ *     $( document.body ).append( windowManager.$element );
  *     windowManager.addWindows( [ myDialog ] );
  *     // Open the window!
  *     windowManager.openWindow( myDialog );
@@ -2828,7 +2823,7 @@ OO.ui.Dialog.prototype.executeAction = function ( action ) {
  *
  *     // Create and append a window manager.
  *     var windowManager = new OO.ui.WindowManager();
- *     $( 'body' ).append( windowManager.$element );
+ *     $( document.body ).append( windowManager.$element );
  *     windowManager.addWindows( [ messageDialog ] );
  *     // Open the window.
  *     windowManager.openWindow( messageDialog, {
@@ -3183,7 +3178,7 @@ OO.ui.MessageDialog.prototype.fitActions = function () {
  *     };
  *
  *     var windowManager = new OO.ui.WindowManager();
- *     $( 'body' ).append( windowManager.$element );
+ *     $( document.body ).append( windowManager.$element );
  *
  *     var dialog = new MyProcessDialog();
  *     windowManager.addWindows( [ dialog ] );
@@ -3512,7 +3507,7 @@ OO.ui.ProcessDialog.prototype.getTeardownProcess = function ( data ) {
 OO.ui.getWindowManager = function () {
        if ( !OO.ui.windowManager ) {
                OO.ui.windowManager = new OO.ui.WindowManager();
-               $( 'body' ).append( OO.ui.windowManager.$element );
+               $( document.body ).append( OO.ui.windowManager.$element );
                OO.ui.windowManager.addWindows( [ new OO.ui.MessageDialog() ] );
        }
        return OO.ui.windowManager;