aboutsummaryrefslogtreecommitdiffstats
path: root/resources/lib/oojs-ui/oojs-ui-windows.js
diff options
context:
space:
mode:
authorJames D. Forrester <jforrester@wikimedia.org>2017-09-26 16:28:20 -0400
committerJames D. Forrester <jforrester@wikimedia.org>2017-09-26 16:28:21 -0400
commit3a06075f12b0af0579e24ae1d13dc74fc8db8190 (patch)
tree367389b37201ac19801a69c116818041c7ca4160 /resources/lib/oojs-ui/oojs-ui-windows.js
parent5d482513e80807daf883b32df2d3b1d3118e5f37 (diff)
downloadmediawikicore-3a06075f12b0af0579e24ae1d13dc74fc8db8190.tar.gz
mediawikicore-3a06075f12b0af0579e24ae1d13dc74fc8db8190.zip
Update OOjs UI to v0.23.2
Release notes: https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.23.2 Depends-On: I9d1264ebf456cadc7e350c2558a9997a2a0633c4 Change-Id: I9bbd4b8ff6333816e7ba73b3c033623753bb6df5
Diffstat (limited to 'resources/lib/oojs-ui/oojs-ui-windows.js')
-rw-r--r--resources/lib/oojs-ui/oojs-ui-windows.js24
1 files changed, 19 insertions, 5 deletions
diff --git a/resources/lib/oojs-ui/oojs-ui-windows.js b/resources/lib/oojs-ui/oojs-ui-windows.js
index 98b110a3bd39..ff576be896cd 100644
--- a/resources/lib/oojs-ui/oojs-ui-windows.js
+++ b/resources/lib/oojs-ui/oojs-ui-windows.js
@@ -1,12 +1,12 @@
/*!
- * 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 ) {
@@ -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;