moved cache clearing to its own method for future development

This commit is contained in:
Kerrick Long
2012-04-29 03:32:45 -05:00
parent c502754d05
commit 6cb3e84e0f
2 changed files with 12 additions and 2 deletions
+1 -2
View File
@@ -12,8 +12,7 @@
background = new Background();
function initBackground() {
cache.removeAll();
button.setBadgeDefaults();
background.clearCache();
chrome.tabs.onUpdated.addListener(background.prepareBrowserAction);
background.watchMail();
reddit.getReddits();
+11
View File
@@ -934,6 +934,17 @@ function Background() {
return true;
}
/**
* Clear cached data and reset cleared browser buttons
* @alias Background.clearCache(tabId, info, tab)
* @return {Boolean} Returns true.
* @method
*/
Background.prototype.clearCache = function () {
cache.removeAll();
button.setBadgeDefaults();
};
/**
* Prepare the browser action (badge, popup, etc.) for a given tab.
* @alias Background.prepareBrowserAction(tabId, info, tab)