[BUGFIX] Check if popup window is there before focusing it 06/44806/2
authorMarkus Klein <markus.klein@typo3.org>
Thu, 19 Nov 2015 19:15:09 +0000 (20:15 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Thu, 19 Nov 2015 19:47:21 +0000 (20:47 +0100)
A popup might be blocked by the browser. Check if the window
is really available before putting focus to it to avoid a JS error.

Resolves: #71705
Releases: master
Change-Id: I30d71ac76509c622c4619857e9c19dc9c20c314a
Reviewed-on: https://review.typo3.org/44806
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Valentin Despa <info@vdespa.de>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Resources/Public/JavaScript/LoginRefresh.js

index 1c04cf6..3ce5481 100644 (file)
@@ -258,7 +258,9 @@ define(['jquery', 'bootstrap'], function($) {
         */
        LoginRefresh.showLoginPopup = function() {
                var vHWin = window.open(LoginRefresh.loginFramesetUrl, 'relogin_' + TYPO3.configuration.uniqueID, 'height=450,width=700,status=0,menubar=0,location=1');
-               vHWin.focus();
+               if (vHWin) {
+                       vHWin.focus();
+               }
        };
 
        /**