From ad680a6477b01268c1dfd56a25703effd321484a Mon Sep 17 00:00:00 2001 From: foudfou Date: Sat, 24 Sep 2011 13:15:38 +0200 Subject: [PATCH] fix options' UI --- src/chrome/content/options.js | 13 ++++++++++--- src/chrome/content/options.xul | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/chrome/content/options.js b/src/chrome/content/options.js index 91197e0..1a0384a 100644 --- a/src/chrome/content/options.js +++ b/src/chrome/content/options.js @@ -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); } diff --git a/src/chrome/content/options.xul b/src/chrome/content/options.xul index c8a7c8d..054c886 100644 --- a/src/chrome/content/options.xul +++ b/src/chrome/content/options.xul @@ -23,7 +23,7 @@ - +