Bug 1032932 fix talos regression with share button, r=Gijs

This commit is contained in:
Shane Caraveo 2014-07-03 12:11:28 -07:00
parent 69ed385dfd
commit 5e61a2db19
2 changed files with 9 additions and 7 deletions

View File

@ -551,14 +551,15 @@ SocialShare = {
},
update: function() {
let shareButton = this.shareButton;
if (!shareButton)
let widget = CustomizableUI.getWidget("social-share-button");
if (!widget)
return;
// if we got here, the button is in the window somewhere, update it's hidden
// state based on available providers.
shareButton.hidden = !SocialUI.enabled ||
[p for (p of Social.providers) if (p.shareURL)].length == 0;
let disabled = shareButton.hidden || !this.canSharePage(gBrowser.currentURI);
let shareButton = widget.forWindow(window).node;
// hidden state is based on available share providers and location of
// button. It's always visible and disabled in the customization palette.
shareButton.hidden = !SocialUI.enabled || (widget.areaType &&
[p for (p of Social.providers) if (p.shareURL)].length == 0);
let disabled = !widget.areaType || shareButton.hidden || !this.canSharePage(gBrowser.currentURI);
// 1. update the relevent command's disabled state so the keyboard
// shortcut only works when available.

View File

@ -939,6 +939,7 @@
tooltiptext="&sharePageCmd.label;"
cui-areatype="toolbar"
removable="true"
hidden="true"
command="Social:SharePage"/>
</hbox>