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 Ci = Components.interfaces;
|
||||||
const Cu = Components.utils;
|
const Cu = Components.utils;
|
||||||
|
|
||||||
Cu.import("resource:///modules/mailServices.js");
|
|
||||||
Cu.import("resource://firetray/FiretrayHandler.jsm");
|
Cu.import("resource://firetray/FiretrayHandler.jsm");
|
||||||
Cu.import("resource://firetray/commons.js");
|
Cu.import("resource://firetray/commons.js");
|
||||||
|
|
||||||
@ -22,9 +21,16 @@ firetray.UIOptions = {
|
|||||||
if(firetray.Handler.inMailApp) {
|
if(firetray.Handler.inMailApp) {
|
||||||
Cu.import("resource://firetray/FiretrayMessaging.jsm");
|
Cu.import("resource://firetray/FiretrayMessaging.jsm");
|
||||||
this.insertMailAccountsExcluded(this.accountBoxId);
|
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) {
|
insertMailAccountsExcluded: function(parentId) {
|
||||||
// the DOM parent where we do appendChild
|
// the DOM parent where we do appendChild
|
||||||
let targetNode = document.getElementById(parentId);
|
let targetNode = document.getElementById(parentId);
|
||||||
@ -40,8 +46,9 @@ firetray.UIOptions = {
|
|||||||
nodeAccount.setAttribute('label', accountServer.rootFolder.name);
|
nodeAccount.setAttribute('label', accountServer.rootFolder.name);
|
||||||
nodeAccount.setAttribute('checked',
|
nodeAccount.setAttribute('checked',
|
||||||
(firetray.Messaging.getPrefAccountsExcluded().indexOf(accountServerKey) >= 0));
|
(firetray.Messaging.getPrefAccountsExcluded().indexOf(accountServerKey) >= 0));
|
||||||
nodeAccount.setAttribute('oncommand',
|
let that = this;
|
||||||
'firetray.UIOptions.updateMailAccountsExcluded(firetray.UIOptions.accountBoxId)');
|
nodeAccount.addEventListener('command', function(e){
|
||||||
|
that.updateMailAccountsExcluded(that.accountBoxId);});
|
||||||
targetNode.appendChild(nodeAccount);
|
targetNode.appendChild(nodeAccount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user