Added loading state

This commit is contained in:
Kerrick Long
2011-07-15 00:45:17 -05:00
parent 2f3442be4a
commit 23c2e59059
+14
View File
@@ -154,6 +154,20 @@ BrowserAction.prototype.setBadgeDefaults = function (tabId) {
return true;
};
/**
* Set the browser icon badge to its loading state.
* @alias BrowserAction.setBadgeLoading(tabId)
* @param {Number} tabId If given, only sets loading state for this tab.
* @return {Boolean} Returns true.
* @method
*/
BrowserAction.prototype.setBadgeLoading = function (tabId) {
chrome.browserAction.setBadgeText({'text': '', 'tabId': tabId});
chrome.browserAction.setTitle({'title': 'Loading data...', 'tabId': tabId});
chrome.browserAction.setPopup({popup: '', tabId: tabId});
return true;
};
/**
* Set the browser icon badge for a page.
* @alias BrowserAction.setBadgeFor(url, tabId)