From c352f647d33a8a285f604d5f805fec2d09cb1762 Mon Sep 17 00:00:00 2001 From: ElbertF Date: Sat, 22 Sep 2012 14:33:06 +1000 Subject: [PATCH] Improved add-on bar positioning --- drivers/firefox/content/js/driver.js | 30 +++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/firefox/content/js/driver.js b/drivers/firefox/content/js/driver.js index 157759f24..e9c7aa8bb 100644 --- a/drivers/firefox/content/js/driver.js +++ b/drivers/firefox/content/js/driver.js @@ -46,6 +46,8 @@ container(); + bindings(); + // Version check addon.version = addon.version; @@ -231,11 +233,21 @@ * Move container to address or addon bar */ function container() { - $('#wappalyzer-container') - .remove() - .prependTo(prefs.getBoolPref('addonBar') ? $('#wappalyzer-addonbar') : $('#urlbar-icons')) - ; + if ( prefs.getBoolPref('addonBar') ) { + $('#wappalyzer-container').prependTo($('#wappalyzer-addonbar')); + + $('#wappalyzer-addonbar').show(); + } else { + $('#wappalyzer-container').prependTo($('#urlbar-icons')); + $('#wappalyzer-addonbar').hide(); + } + } + + /** + * Bindings + */ + function bindings() { // Menu items var prefix = '#wappalyzer-menu-'; @@ -268,11 +280,6 @@ } }); - $(prefix + 'donate') - .bind('command', function() { - w.driver.goToURL({ url: w.config.websiteURL + 'donate' }) - }); - $(prefix + 'feedback') .bind('command', function() { w.driver.goToURL({ url: w.config.websiteURL + 'contact' }) @@ -292,11 +299,6 @@ .bind('command', function() { w.driver.goToURL({ url: w.config.twitterURL}) }); - - $(prefix + 'gplus') - .bind('command', function() { - w.driver.goToURL({ url: w.config.gplusURL }) - }); } w.init();