diff options
author | papush | 2021-08-29 12:52:51 +0200 |
---|---|---|
committer | papush | 2021-08-29 12:52:51 +0200 |
commit | 56ed13df217639ddad0407d4aaec980a48d17089 (patch) | |
tree | dae9b01ed301c8c00c0d16e53ca453508a10394c /chrome/js | |
parent | 3936477a78320980777e0dd9b951e0265a06a751 (diff) |
use a proper toolbar button instead of a statusbar one
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) { |