Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/166146

Change subject: Revert "Try to stop user from tabbing outside of open dialog 
box"
......................................................................

Revert "Try to stop user from tabbing outside of open dialog box"

Turns out :focusable is a jQuery UI feature.

This reverts commit 3232d6fa6eafe2ee84a9e095f59a394b8d3ac911.

Change-Id: I72724a6df8d3df6dfe6e98da5f010fc563a362d8
---
M src/Window.js
1 file changed, 3 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/46/166146/1

diff --git a/src/Window.js b/src/Window.js
index e09f96e..c43ada4 100644
--- a/src/Window.js
+++ b/src/Window.js
@@ -549,7 +549,6 @@
        this.$body = this.$( '<div>' );
        this.$foot = this.$( '<div>' );
        this.$overlay = this.$( '<div>' );
-       this.$focusTrap = this.$( '<div>' ).prop( 'tabIndex', 0 );
 
        // Events
        this.$element.on( 'mousedown', OO.ui.bind( this.onMouseDown, this ) );
@@ -559,18 +558,9 @@
        this.$body.addClass( 'oo-ui-window-body' );
        this.$foot.addClass( 'oo-ui-window-foot' );
        this.$overlay.addClass( 'oo-ui-window-overlay' );
-       this.$focusTrap.addClass( 'oo-ui-window-focustrap' );
-       this.$content.append( this.$head, this.$body, this.$foot, 
this.$overlay, this.$focusTrap );
+       this.$content.append( this.$head, this.$body, this.$foot, this.$overlay 
);
 
        return this;
-};
-
-/**
- * Called when someone tries to focus the hidden element at the end of the 
dialog.
- * Sends focus back to the start of the dialog.
- */
-OO.ui.Window.prototype.onFocusTrapFocused = function () {
-       this.$content.find( ':focusable:first' ).focus();
 };
 
 /**
@@ -615,8 +605,6 @@
 
        this.$element.show();
        this.visible = true;
-       this.focusTrapHandler = OO.ui.bind( this.onFocusTrapFocused, this );
-       this.$focusTrap.on( 'focus', this.focusTrapHandler );
        this.getSetupProcess( data ).execute().done( function () {
                // Force redraw by asking the browser to measure the elements' 
widths
                win.$element.addClass( 'oo-ui-window-setup' ).width();
@@ -695,15 +683,14 @@
        var win = this,
                deferred = $.Deferred();
 
-       this.getTeardownProcess( data ).execute().done( OO.ui.bind( function () 
{
+       this.getTeardownProcess( data ).execute().done( function () {
                // Force redraw by asking the browser to measure the elements' 
widths
                win.$element.removeClass( 'oo-ui-window-setup' ).width();
                win.$content.removeClass( 'oo-ui-window-content-setup' 
).width();
                win.$element.hide();
-               this.$focusTrap.off( 'focus', this.focusTrapHandler );
                win.visible = false;
                deferred.resolve();
-       }, this ) );
+       } );
 
        return deferred.promise();
 };

-- 
To view, visit https://gerrit.wikimedia.org/r/166146
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72724a6df8d3df6dfe6e98da5f010fc563a362d8
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <kren...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to