Bug 879980 - Subscribe button appears disabled when in the palette, r=mconley

This commit is contained in:
Gijs Kruitbosch 2013-06-10 23:28:07 +02:00
parent 75790d65f1
commit 56fb10a7c5
2 changed files with 12 additions and 4 deletions

View File

@ -118,8 +118,15 @@ var FeedHandler = {
var haveFeeds = feeds && feeds.length > 0;
var feedButton = document.getElementById("feed-button");
// Don't disable the button for customization mode. We check the URL
// here rather than the window's [customizing] attribute because they
// do not change at the same time, and the browser's feed info pertains
// to the selected page's browser, so using the location ensures
// this check is always correct:
let contentLoc = window.content && window.content.location.href;
let areCustomizing = contentLoc == "about:customizing";
if (feedButton)
feedButton.disabled = !haveFeeds;
feedButton.disabled = !areCustomizing && !haveFeeds;
if (!haveFeeds) {
this._feedMenuitem.setAttribute("disabled", "true");

View File

@ -456,9 +456,10 @@ const CustomizableWidgets = [{
},
onCreated: function(node) {
let win = node.ownerDocument.defaultView;
let selectedBrowser = win.gBrowser.selectedBrowser;
let feeds = selectedBrowser && selectedBrowser.feeds;
if (!feeds || !feeds.length) {
let browser = win.gBrowser.selectedBrowser;
let feeds = browser && browser.feeds && browser.feeds.length;
let contentURL = browser && browser.currentURI && browser.currentURI.spec;
if (contentURL != "about:customizing" && !feeds) {
node.setAttribute("disabled", "true");
}
}