From b7543ffccc1aa9c4e70b26a801d1f2a096065cde Mon Sep 17 00:00:00 2001 From: Kerrick Long Date: Fri, 15 Jul 2011 10:24:23 -0500 Subject: [PATCH] User can now click on the browser action to reload data. --- js/common.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/common.js b/js/common.js index dc5bbd6..c136f95 100644 --- a/js/common.js +++ b/js/common.js @@ -148,9 +148,12 @@ function BrowserAction() { */ BrowserAction.prototype.setBadgeDefaults = function (tabId) { chrome.browserAction.setBadgeText({'text': '?', 'tabId': tabId}); - chrome.browserAction.setTitle({'title': 'Refresh the page to load data.', 'tabId': tabId}); + chrome.browserAction.setTitle({'title': 'Click to load data.', 'tabId': tabId}); chrome.browserAction.setBadgeBackgroundColor({'color': [192, 192, 192, 255], 'tabId': tabId}); chrome.browserAction.setPopup({popup: '', tabId: tabId}); + chrome.browserAction.onClicked.addListener(function(tab) { + reddit.getInfo(tab.url, tab.id); + }); return true; };