Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/342227 )

Change subject: Remove $returnFocusTo hack now null is supported upstream
......................................................................

Remove $returnFocusTo hack now null is supported upstream

Change-Id: Iea627aed990eb4bc54b43cfb9ae8e4dd5e2d072e
---
M src/ui/actions/ve.ui.WindowAction.js
M src/ui/ve.ui.Surface.js
M src/ui/widgets/ve.ui.LanguageInputWidget.js
3 files changed, 5 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/27/342227/1

diff --git a/src/ui/actions/ve.ui.WindowAction.js 
b/src/ui/actions/ve.ui.WindowAction.js
index 63b7089..5e3d83c 100644
--- a/src/ui/actions/ve.ui.WindowAction.js
+++ b/src/ui/actions/ve.ui.WindowAction.js
@@ -55,8 +55,6 @@
                surface = this.surface,
                fragment = surface.getModel().getFragment( undefined, true ),
                dir = surface.getView().getSelection().getDirection(),
-               // HACK: Allow $returnFocusTo to take null upstream
-               $noFocus = [ { focus: function () {} } ],
                windowClass = ve.ui.windowFactory.lookup( name ),
                mayContainFragment = windowClass.prototype instanceof 
ve.ui.FragmentDialog ||
                        windowClass.prototype instanceof 
ve.ui.FragmentInspector ||
@@ -90,7 +88,7 @@
                fragmentPromise = $.Deferred().resolve( fragment ).promise();
        }
 
-       data = ve.extendObject( { dir: dir }, data, { $returnFocusTo: $noFocus 
} );
+       data = ve.extendObject( { dir: dir }, data, { $returnFocusTo: null } );
 
        if ( windowType === 'toolbar' || windowType === 'inspector' ) {
                data = ve.extendObject( data, { surface: surface } );
diff --git a/src/ui/ve.ui.Surface.js b/src/ui/ve.ui.Surface.js
index 750acf0..e25a74b 100644
--- a/src/ui/ve.ui.Surface.js
+++ b/src/ui/ve.ui.Surface.js
@@ -738,11 +738,9 @@
 
 ve.ui.Surface.prototype.showProgress = function () {
        var dialogs = this.dialogs,
-               progresses = this.progresses,
-               // HACK: Allow $returnFocusTo to take null upstream
-               $noFocus = [ { focus: function () {} } ];
+               progresses = this.progresses;
 
-       dialogs.openWindow( 'progress', { progresses: progresses, 
$returnFocusTo: $noFocus } );
+       dialogs.openWindow( 'progress', { progresses: progresses, 
$returnFocusTo: null } );
        this.progresses = [];
 };
 
diff --git a/src/ui/widgets/ve.ui.LanguageInputWidget.js 
b/src/ui/widgets/ve.ui.LanguageInputWidget.js
index 0645479..81fd989 100644
--- a/src/ui/widgets/ve.ui.LanguageInputWidget.js
+++ b/src/ui/widgets/ve.ui.LanguageInputWidget.js
@@ -122,10 +122,8 @@
  * Handle find language button click events.
  */
 ve.ui.LanguageInputWidget.prototype.onFindLanguageButtonClick = function () {
-       var widget = this,
-               // HACK: Allow $returnFocusTo to take null upstream
-               $noFocus = [ { focus: function () {} } ];
-       this.dialogs.openWindow( 'languageSearch', { availableLanguages: 
this.availableLanguages, $returnFocusTo: $noFocus } )
+       var widget = this;
+       this.dialogs.openWindow( 'languageSearch', { availableLanguages: 
this.availableLanguages, $returnFocusTo: null } )
                .then( function ( opened ) {
                        opened.then( function ( closing ) {
                                closing.then( function ( data ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea627aed990eb4bc54b43cfb9ae8e4dd5e2d072e
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>

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

Reply via email to