Bug 597644: feed button/menuitem isn't updated properly on back/forward navigation, r=dao, a=blocking

--HG--
extra : rebase_source : 13b67ff4b345902fb7f88dfbe875674462374cd6
This commit is contained in:
Gavin Sharp 2010-10-26 20:16:31 -04:00
Родитель 040719e5ee
Коммит 6f1bd2b82f
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -6705,6 +6705,8 @@ var FeedHandler = {
* a page is loaded or the user switches tabs to a page that has feeds.
*/
updateFeeds: function() {
clearTimeout(this._updateFeedTimeout);
var feeds = gBrowser.selectedBrowser.feeds;
var haveFeeds = feeds && feeds.length > 0;
@ -6742,6 +6744,15 @@ var FeedHandler = {
browserForLink.feeds = [];
browserForLink.feeds.push({ href: link.href, title: link.title });
// If this addition was for the current browser, update the UI. For
// background browsers, we'll update on tab switch.
if (browserForLink == gBrowser.selectedBrowser) {
// Batch updates to avoid updating the UI for multiple onLinkAdded events
// fired within 100ms of each other.
clearTimeout(this._updateFeedTimeout);
this._updateFeedTimeout = setTimeout(this.updateFeeds.bind(this), 100);
}
}
};