Bug 450413 - Mark messages as read textbox doesn't look disabled, when reopening prefs with delay selected but checkbox unchecked, r=mkmelin
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 28 Oct 2008 20:42:36 -0700
changeset 755 ad2956c65a25cf43114068696d38e9a4b8870aa6
parent 754 a1b646111579206bf09f0b1f2611cf3783922c05
child 756 a875ba644fa99beb146ef17cecbbf8d5a49f5602
push idunknown
push userunknown
push dateunknown
reviewersmkmelin
bugs450413
Bug 450413 - Mark messages as read textbox doesn't look disabled, when reopening prefs with delay selected but checkbox unchecked, r=mkmelin
mail/components/preferences/advanced.js
--- a/mail/components/preferences/advanced.js
+++ b/mail/components/preferences/advanced.js
@@ -39,17 +39,16 @@
 var gAdvancedPane = {
   mPane: null,
   mInitialized: false,
 
   init: function ()
   {
     this.mPane = document.getElementById("paneAdvanced");
     this.updateMarkAsReadOptions(document.getElementById("automaticallyMarkAsRead").checked);
-    this.updateMarkAsReadTextbox(false);
 
     if ("arguments" in window && window.arguments[1] && document.getElementById(window.arguments[1]))
       document.getElementById("advancedPrefs").selectedTab = document.getElementById(window.arguments[1]);
     else 
     {
       var preference = document.getElementById("mail.preferences.advanced.selectedTabIndex");
       if (preference.value)
         document.getElementById("advancedPrefs").selectedIndex = preference.value;
@@ -238,17 +237,19 @@ var gAdvancedPane = {
                              .createInstance(Components.interfaces.nsIUpdatePrompt);
     prompter.showUpdateHistory(window);
   },
 
   updateMarkAsReadOptions: function(enableRadioGroup)
   {
     document.getElementById('markAsReadAutoPreferences').disabled = !enableRadioGroup;
     // ... and the extras!
-    document.getElementById('markAsReadDelay').disabled = !enableRadioGroup;
+    document.getElementById('markAsReadDelay').disabled =
+      (!enableRadioGroup ||
+       !document.getElementById("mailnews.mark_message_read.delay").value);
     document.getElementById('secondsLabel').disabled = !enableRadioGroup;
   },
 
   updateMarkAsReadTextbox: function(aFocusTextBox)
   {
     var textbox = document.getElementById('markAsReadDelay');
     textbox.disabled = !document.getElementById('markAsReadAfterDelay').selected;
     if (!textbox.disabled && aFocusTextBox)