From 56fb10a7c5fed534c2e4746b815cde3535c6b5d1 Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Mon, 10 Jun 2013 23:28:07 +0200 Subject: [PATCH] Bug 879980 - Subscribe button appears disabled when in the palette, r=mconley --- browser/base/content/browser-feeds.js | 9 ++++++++- .../customizableui/src/CustomizableWidgets.jsm | 7 ++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/browser/base/content/browser-feeds.js b/browser/base/content/browser-feeds.js index 5b432ede2f9..195d049b1e3 100644 --- a/browser/base/content/browser-feeds.js +++ b/browser/base/content/browser-feeds.js @@ -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"); diff --git a/browser/components/customizableui/src/CustomizableWidgets.jsm b/browser/components/customizableui/src/CustomizableWidgets.jsm index 6f8425ca08a..81737433f0b 100644 --- a/browser/components/customizableui/src/CustomizableWidgets.jsm +++ b/browser/components/customizableui/src/CustomizableWidgets.jsm @@ -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"); } }