1
0
mirror of https://github.com/moparisthebest/FireTray synced 2024-12-22 22:08:49 -05:00

fix options' UI

This commit is contained in:
foudfou 2011-09-24 13:15:38 +02:00
parent d3b07c348d
commit ad680a6477
2 changed files with 11 additions and 4 deletions

View File

@ -4,7 +4,6 @@ const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource:///modules/mailServices.js");
Cu.import("resource://firetray/FiretrayHandler.jsm");
Cu.import("resource://firetray/commons.js");
@ -22,9 +21,16 @@ firetray.UIOptions = {
if(firetray.Handler.inMailApp) {
Cu.import("resource://firetray/FiretrayMessaging.jsm");
this.insertMailAccountsExcluded(this.accountBoxId);
} else {
this.hideMailAccountsExcluded(this.accountBoxId);
}
},
hideMailAccountsExcluded: function(parentId) {
let targetNode = document.getElementById(parentId);
targetNode.hidden = true; //!(appType & Firetray_MAIL);
},
insertMailAccountsExcluded: function(parentId) {
// the DOM parent where we do appendChild
let targetNode = document.getElementById(parentId);
@ -40,8 +46,9 @@ firetray.UIOptions = {
nodeAccount.setAttribute('label', accountServer.rootFolder.name);
nodeAccount.setAttribute('checked',
(firetray.Messaging.getPrefAccountsExcluded().indexOf(accountServerKey) >= 0));
nodeAccount.setAttribute('oncommand',
'firetray.UIOptions.updateMailAccountsExcluded(firetray.UIOptions.accountBoxId)');
let that = this;
nodeAccount.addEventListener('command', function(e){
that.updateMailAccountsExcluded(that.accountBoxId);});
targetNode.appendChild(nodeAccount);
}

View File

@ -23,7 +23,7 @@
<groupbox id="accounts_box"> <!-- firetray.UIOptions.accountBoxId -->
<caption label="&mail_accounts_exclude;"/>
<!-- accounts are dynamically added here with insert_accounts_name() functions, called at the bottom of this file -->
<!-- accounts are dynamically added here with insert_accounts_name() functions, called at the bottom of this file -->
</groupbox>
</prefpane>