Bug 1516134 - run onChangedManualEdit() in emailWizard even if menulist hasn't changed from non-editable to editable, so that settings are read properly. r=jorgk DONTBUILD
authoraceman <acelists@atlas.sk>
Sat, 05 Jan 2019 18:00:00 +0100
changeset 34123 1968c2aef7aef6bfa94397ecc2df8b0ae4f99374
parent 34122 e63b335d0e435a7f26b111d0a435e0a5ea155d15
child 34124 4530e74cd16819dabcb07061938af5dec07e86cc
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersjorgk
bugs1516134
Bug 1516134 - run onChangedManualEdit() in emailWizard even if menulist hasn't changed from non-editable to editable, so that settings are read properly. r=jorgk DONTBUILD
mail/components/accountcreation/content/emailWizard.js
--- a/mail/components/accountcreation/content/emailWizard.js
+++ b/mail/components/accountcreation/content/emailWizard.js
@@ -1413,17 +1413,17 @@ EmailConfigWizard.prototype =
   /**
    * Sets the label of the first entry of the dropdown which represents
    * the new outgoing server.
    */
   onOpenOutgoingDropdown() {
     var menulist = e("outgoing_hostname");
     // If the menulist is not editable, there is nothing to update
     // and menulist.inputField does not even exist.
-    if (!menulist.editable)
+    if (menulist.getAttribute("editable") != "true")
       return;
 
     var menuitem = menulist.getItemAtIndex(0);
     assert(!menuitem.serverKey, "I wanted the special item for the new host");
     menuitem.label = menulist.inputField.value;
   },
 
   /**
@@ -1437,26 +1437,30 @@ EmailConfigWizard.prototype =
       // an existing server has been selected from the dropdown
       menulist.removeAttribute("editable");
       _hide("outgoing_port");
       _hide("outgoing_ssl");
       _hide("outgoing_authMethod");
       this.onChangedManualEdit();
     } else {
       // new server, with hostname, port etc.
-      menulist.setAttribute("editable", "true");
       _show("outgoing_port");
       _show("outgoing_ssl");
       _show("outgoing_authMethod");
 
       // We cannot rely on the editable menulist binding being
       // attached immediately.
-      menulist.addEventListener("bindingattached", () => {
+      if (menulist.getAttribute("editable") != "true") {
+        menulist.setAttribute("editable", "true");
+        menulist.addEventListener("bindingattached", () => {
+          this.onChangedManualEdit();
+        }, { once: true });
+      } else {
         this.onChangedManualEdit();
-      }, { once: true });
+      }
     }
   },
 
   onChangedManualEdit() {
     if (this._abortable) {
       this.onStop();
     }
     this.validateManualEditComplete();