Bug 804091 - force firing of 'onchange' events when leaving an Account manager pane. r=Neil, r=mconley a=Standard8 SEAMONKEY_2_15b4_BUILD1 SEAMONKEY_2_15b4_RELEASE
authoraceman <acelists@atlas.sk>
Mon, 29 Oct 2012 13:49:00 -0400
changeset 13988 38584725196f9e00070b2770dd523ee21f389766
parent 13987 c1eb13cdcbc67a3e7418f0a0848b2fc7608db6cf
child 13989 e483fc85f9d96baf84d8fb13a425d5b7b283b769
child 13991 1bdd7893efd95888366950367a1030b5a695f4b3
push idunknown
push userunknown
push dateunknown
reviewersNeil, mconley, Standard8
bugs804091
Bug 804091 - force firing of 'onchange' events when leaving an Account manager pane. r=Neil, r=mconley a=Standard8
mailnews/base/prefs/content/AccountManager.js
--- a/mailnews/base/prefs/content/AccountManager.js
+++ b/mailnews/base/prefs/content/AccountManager.js
@@ -859,16 +859,24 @@ function onAccountTreeSelect(pageId, acc
       gSmtpHostNameIsIllegal = false;
       selectServer(currentAccount.incomingServer, currentPageId);
       return true;
     }
 
     if (gRestartNeeded)
       onAccept(false);
   }
+
+  if (currentPageId) {
+    // Change focus to the account tree first so that any 'onchange' handlers
+    // on elements in the current page have a chance to run before the page
+    // is saved and replaced by the new one.
+    tree.focus();
+  }
+
   // save the previous page
   savePage(currentAccount);
 
   let changeAccount = (account != currentAccount);
 
   if (changeView)
     selectServer(account.incomingServer, pageId);