/*!
- * OOjs UI v0.23.1
+ * OOjs UI v0.23.2
* 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-09-26T20:18:42Z
*/
( function ( OO ) {
* 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' }
// Initialization
this.$element
.addClass( 'oo-ui-windowManager' )
+ .attr( 'aria-hidden', true )
.toggleClass( 'oo-ui-windowManager-modal', this.modal );
};
* @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;