diff options
-rw-r--r-- | chrome/js/browserOverlay.js | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/chrome/js/browserOverlay.js b/chrome/js/browserOverlay.js index 39066b8..2767d7b 100644 --- a/chrome/js/browserOverlay.js +++ b/chrome/js/browserOverlay.js @@ -38,15 +38,8 @@ var RedirectorOverlay = { changedPrefs : function(prefs) { var button = document.getElementById('redirector-button'); - - if (prefs.enabled) { - button.setAttribute('disabled', true); - } else { - button.removeAttribute('disabled'); - } - - // document.getElementById('redirector-status').hidden = !prefs.showStatusBarIcon; document.getElementById('redirector-context').hidden = !prefs.showContextMenu; + this.refreshUI(); }, showContextMenu : function(event) { @@ -70,8 +63,7 @@ var RedirectorOverlay = { this.openSettings(); }, - toggleEnabled: function(event) { - this.prefs.enabled = !this.prefs.enabled; + refreshUI: function() { let button = document.getElementById("redirector-button"); let item = document.getElementById("redirector-enabled-item"); if (this.prefs.enabled) { @@ -83,6 +75,11 @@ var RedirectorOverlay = { } }, + toggleEnabled: function(event) { + this.prefs.enabled = !this.prefs.enabled; + this.refreshUI(); + }, + openSettings : function() { gBrowser.selectedTab = gBrowser.addTab("chrome://redirector/content/redirector.html"); }, |