Merge "RCFilters: define consistent interface in ChangesListFilterGroup"
[lhc/web/wiklou.git] / resources / lib / oojs-ui / oojs-ui-windows.js
index 98b110a..d34d19c 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.23.1
+ * OOjs UI v0.24.0
  * 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-20T00:31:56Z
+ * Date: 2017-10-17T23:18:51Z
  */
 ( function ( OO ) {
 
@@ -117,7 +117,7 @@ OO.ui.ActionWidget.prototype.getModes = function () {
  *     MyProcessDialog.static.name = 'myProcessDialog';
  *     // An action set that uses modes ('edit' and 'help' mode, in this example).
  *     MyProcessDialog.static.actions = [
- *         { action: 'continue', modes: 'edit', label: 'Continue', flags: [ 'primary', 'constructive' ] },
+ *         { action: 'continue', modes: 'edit', label: 'Continue', flags: [ 'primary', 'progressive' ] },
  *         { action: 'help', modes: 'edit', label: 'Help' },
  *         { modes: 'edit', label: 'Cancel', flags: 'safe' },
  *         { action: 'back', modes: 'help', label: 'Back', flags: 'safe' }
@@ -1034,6 +1034,7 @@ OO.ui.WindowManager = function OoUiWindowManager( config ) {
        // Initialization
        this.$element
                .addClass( 'oo-ui-windowManager' )
+               .attr( 'aria-hidden', true )
                .toggleClass( 'oo-ui-windowManager-modal', this.modal );
 };
 
@@ -1694,20 +1695,33 @@ OO.ui.WindowManager.prototype.toggleGlobalEvents = function ( on ) {
  * @chainable
  */
 OO.ui.WindowManager.prototype.toggleAriaIsolation = function ( isolate ) {
+       var $topLevelElement;
        isolate = isolate === undefined ? !this.$ariaHidden : !!isolate;
 
        if ( isolate ) {
                if ( !this.$ariaHidden ) {
+                       // Find the top level element containing the window manager or the
+                       // window manager's element itself in case its a direct child of body
+                       $topLevelElement = this.$element.parentsUntil( 'body' ).last();
+                       $topLevelElement = $topLevelElement.length === 0 ? this.$element : $topLevelElement;
+
+                       // In case previously set by another window manager
+                       this.$element.removeAttr( 'aria-hidden' );
+
                        // Hide everything other than the window manager from screen readers
                        this.$ariaHidden = $( 'body' )
                                .children()
-                               .not( this.$element.parentsUntil( 'body' ).last() )
-                               .attr( 'aria-hidden', '' );
+                               .not( 'script' )
+                               .not( $topLevelElement )
+                               .attr( 'aria-hidden', true );
                }
        } else if ( this.$ariaHidden ) {
                // Restore screen reader visibility
                this.$ariaHidden.removeAttr( 'aria-hidden' );
                this.$ariaHidden = null;
+
+               // and hide the window manager
+               this.$element.attr( 'aria-hidden', true );
        }
 
        return this;