diff options
Diffstat (limited to 'chrome/js')
-rw-r--r-- | chrome/js/browserOverlay.js | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/chrome/js/browserOverlay.js b/chrome/js/browserOverlay.js index bfaff90..39066b8 100644 --- a/chrome/js/browserOverlay.js +++ b/chrome/js/browserOverlay.js @@ -37,17 +37,15 @@ var RedirectorOverlay = { }, changedPrefs : function(prefs) { - var statusImg = document.getElementById('redirector-statusbar-img'); + var button = document.getElementById('redirector-button'); if (prefs.enabled) { - statusImg.src = 'chrome://redirector/content/images/statusactive.png' - statusImg.setAttribute('tooltiptext', this.strings.getString('enabledTooltip')); + button.setAttribute('disabled', true); } else { - statusImg.src = 'chrome://redirector/content/images/statusinactive.png' - statusImg.setAttribute('tooltiptext', this.strings.getString('disabledTooltip')); + button.removeAttribute('disabled'); } - document.getElementById('redirector-status').hidden = !prefs.showStatusBarIcon; + // document.getElementById('redirector-status').hidden = !prefs.showStatusBarIcon; document.getElementById('redirector-context').hidden = !prefs.showContextMenu; }, @@ -72,8 +70,17 @@ var RedirectorOverlay = { this.openSettings(); }, - toggleEnabled : function(event) { + toggleEnabled: function(event) { this.prefs.enabled = !this.prefs.enabled; + let button = document.getElementById("redirector-button"); + let item = document.getElementById("redirector-enabled-item"); + if (this.prefs.enabled) { + button.removeAttribute('disabled'); + item.setAttribute('checked', true); + } else { + button.setAttribute('disabled', 'yes'); + item.setAttribute('checked', false); + } }, openSettings : function() { @@ -81,6 +88,7 @@ var RedirectorOverlay = { }, statusBarClick : function(event) { + Redirector.debug('REDIRECTOR: click'); var LEFT = 0, RIGHT = 2; if (event.button == LEFT) { |