Bug 874899 - Hide new options in Notifications pref pane when the old alert is selected. r=IanN, ui-r=Neil, a=IanN
authorrsx11m <rsx11m.pub@gmail.com>
Wed, 22 May 2013 10:12:34 -0500
changeset 15548 7bc2fd64ec45483742899ccafdf17d80442b1e40
parent 15547 485de398bd2fcf2f16e48585afb6a758837df3df
child 15549 c75bd0c80e55ddeec7b3e6fc0460d3110157a64b
push id920
push userbugzilla@standard8.plus.com
push dateMon, 24 Jun 2013 19:03:14 +0000
treeherdercomm-beta@936bfe9d120b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, Neil, IanN
bugs874899
Bug 874899 - Hide new options in Notifications pref pane when the old alert is selected. r=IanN, ui-r=Neil, a=IanN
suite/mailnews/prefs/pref-notifications.js
--- a/suite/mailnews/prefs/pref-notifications.js
+++ b/suite/mailnews/prefs/pref-notifications.js
@@ -9,16 +9,23 @@ var gSoundUrlPref = null;
 
 function Startup()
 {
   // if we don't have the alert service, hide the pref UI for using alerts to notify on new mail
   // see bug #158711
   var newMailNotificationAlertUI = document.getElementById("newMailNotificationAlertBox");
   newMailNotificationAlertUI.hidden = !("@mozilla.org/alerts-service;1" in Components.classes);
 
+  // as long as the old notification code is still around, the new options
+  // won't apply if mail.biff.show_new_alert is false and should be hidden
+  document.getElementById("showAlertPreviewText").hidden =
+  document.getElementById("showAlertSubject").hidden =
+  document.getElementById("showAlertSender").hidden =
+    !Services.prefs.getBoolPref("mail.biff.show_new_alert");
+
   // animate dock icon option currently available for Mac OSX only
   var newMailNotificationBouncePref = document.getElementById("newMailNotificationBounceBox");
   newMailNotificationBouncePref.hidden = !navigator.platform.startsWith("Mac");
 
   // show tray icon option currently available for Windows only
   var newMailNotificationTrayIconPref = document.getElementById("newMailNotificationTrayIconBox");
   newMailNotificationTrayIconPref.hidden = !navigator.platform.startsWith("Win");