mirror of
https://github.com/moparisthebest/FireTray
synced 2024-12-23 06:18:48 -05:00
fix options' UI
This commit is contained in:
parent
d3b07c348d
commit
ad680a6477
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user