Bug 1590503 - Follow up: fix failing test. r+a=jorgk
authorAlessandro Castellani <alessandro@thunderbird.net>
Wed, 30 Oct 2019 21:59:19 +0100
changeset 37238 9f4ffa0f05f869a5914f632abd69cf4a3d6acebc
parent 37237 59f2278c050d8c7ad0d6fc8ac8b76e6cbaaca5ad
child 37239 e4607a1592d21563c3daa8ea441519b63fb5ba62
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
bugs1590503
Bug 1590503 - Follow up: fix failing test. r+a=jorgk
mail/components/accountcreation/content/emailWizard.js
--- a/mail/components/accountcreation/content/emailWizard.js
+++ b/mail/components/accountcreation/content/emailWizard.js
@@ -282,21 +282,22 @@ EmailConfigWizard.prototype = {
     window.sizeToContent();
   },
 
   /**
    * Resize the window based on the content height and width.
    * Since the sizeToContent() method doesn't account for the height of
    * wrapped text, we're checking if the width and height of the "mastervbox"
    * is taller than the window width and height. This is necessary to account
-   * for l10n strings or the user manually resizing the window. Bug 1590503.
+   * for l10n strings or the user manually resizing the window.
    */
   resizeDialog() {
-    let contentHeight = document.getElementById("mastervbox").clientHeight;
-    let contentWidth = document.getElementById("mastervbox").clientWidth;
+    let mastervbox = document.getElementById("mastervbox");
+    let contentHeight = mastervbox.clientHeight;
+    let contentWidth = mastervbox.clientWidth;
 
     if (contentHeight > window.innerHeight) {
       window.innerHeight = contentHeight;
     }
 
     if (contentWidth > window.innerWidth) {
       window.innerWidth = contentWidth;
     }
@@ -2001,22 +2002,22 @@ EmailConfigWizard.prototype = {
       },
       function(e) {
         // failed
         // Could be a wrong password, but there are 1000 other
         // reasons why this failed. Only the backend knows.
         // If we got no message, then something other than VerifyLogon failed.
         self.showErrorMsg(e.message || e.toString());
 
-        this.resizeDialog();
         // TODO use switchToMode(), see above
         // give user something to proceed after fixing
         _enable("create_button");
         // hidden in non-manual mode, so it's fine to enable
         _enable("half-manual-test_button");
+        self.resizeDialog();
       }
     );
   },
 
   finish(concreteConfig) {
     gEmailWizardLogger.info("creating account in backend");
     var account = createAccountInBackend(concreteConfig);