Bug 966276 - pop3 account advanced deferring dialog broken. r=squib SEA_2_26_1_RELBRANCH
authoralta88
Fri, 31 Jan 2014 16:27:25 -0700
branchSEA_2_26_1_RELBRANCH
changeset 31067 2330f1f99c2af0517f0eb429a7b8f569df00d5ae
parent 31066 6ceb04d3717d5e6335b69ce9738fef037d0f1468
child 31068 3c60f4ed95d0966657820f4bff8e7c6c351f90c9
push id1
push userclokep@gmail.com
push dateMon, 07 May 2018 22:45:56 +0000
treeherdercomm-esr60@57eacde5ef40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssquib
bugs966276
Bug 966276 - pop3 account advanced deferring dialog broken. r=squib
mailnews/base/prefs/content/am-server-advanced.js
mailnews/base/prefs/content/am-server-advanced.xul
--- a/mailnews/base/prefs/content/am-server-advanced.js
+++ b/mailnews/base/prefs/content/am-server-advanced.js
@@ -49,38 +49,35 @@ function onLoad()
 
     // The current account should not be shown in the folder picker
     // of the "other account" option.
     folderPopup._teardown();
     folderPopup.setAttribute("excludeServers",
                              gServerSettings.account.incomingServer.key);
     folderPopup._ensureInitialized();
 
-    if (gServerSettings.account.incomingServer.isDeferredTo) {
-      // Some other account already defers to this account
-      // therefore this one can't be deferred further.
-      radioGroup.value = "currentAccount";
-      folderPopup.selectFolder();
-      radioGroup.disabled = true;
-    }
-    else if (gFirstDeferredAccount.length)
+    if (gFirstDeferredAccount.length)
     {
-      // The current account is already deferred...
+      // The current account is deferred.
       let account = MailServices.accounts.getAccount(gFirstDeferredAccount);
       radioGroup.value = "otherAccount";
       folderPopup.selectFolder(account.incomingServer.rootFolder);
     }
     else
     {
       // Current account is not deferred.
       radioGroup.value = "currentAccount";
-      // If there are no other suitable accounts to defer to,
-      // then disable the option.
-      if (!folderPopup.selectFolder())
-        document.getElementById("deferToOtherAccount").disabled = true;
+      // If there are no suitable accounts to defer to, then the menulist is
+      // disabled by the picker with an appropriate message.
+      folderPopup.selectFolder();
+      if (gServerSettings.account.incomingServer.isDeferredTo) {
+        // Some other account already defers to this account
+        // therefore this one can't be deferred further.
+        radioGroup.disabled = true;
+      }
     }
   }
 
   var controls = getControls();
 
   for (var i = 0; i < controls.length; i++)
   {
     var slot = controls[i].id;
--- a/mailnews/base/prefs/content/am-server-advanced.xul
+++ b/mailnews/base/prefs/content/am-server-advanced.xul
@@ -115,24 +115,29 @@
                      value="currentAccount"
                      label="&accountDirectory.label;"
                      accesskey="&accountDirectory.accesskey;"/>
             </row>
             <row>
               <radio id="deferToOtherAccount"
                      value="otherAccount"
                      label="&deferToServer.label;"
-                     accesskey="&deferToServer.accesskey;"/>
-                <menulist id="deferredServerFolderPicker"
-                          aria-labelledby="deferToServer">
-                  <menupopup id="deferredServerPopup"
-                             type="folder"
-                             expandFolders="false"
-                             mode="deferred"/>
-                </menulist>
+                     accesskey="&deferToServer.accesskey;">
+                <observes element="deferredServerFolderPicker"
+                          attribute="disabled"/>
+              </radio>
+              <menulist id="deferredServerFolderPicker"
+                        class="folderMenuItem"
+                        aria-labelledby="deferToServer">
+                <menupopup id="deferredServerPopup"
+                           type="folder"
+                           expandFolders="false"
+                           mode="deferred"
+                           oncommand="this.selectFolder(event.target._folder);"/>
+              </menulist>
             </row>
           </rows>
         </radiogroup>
       </hbox>
 
       <separator class="thin"/>
 
       <checkbox amsa_persist="true" id="deferGetNewMail"