mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 814269 - social API keys should be disabled when command not available. r=jaws
This commit is contained in:
parent
dfc6f73415
commit
f0a1041df3
@ -112,7 +112,7 @@
|
||||
<command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
|
||||
<command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>
|
||||
<command id="Browser:ToggleAddonBar" oncommand="toggleAddonBar();"/>
|
||||
<command id="Social:SharePage" oncommand="SocialShareButton.sharePage();"/>
|
||||
<command id="Social:SharePage" oncommand="SocialShareButton.sharePage();" disabled="true"/>
|
||||
<command id="Social:UnsharePage" oncommand="SocialShareButton.unsharePage();"/>
|
||||
<command id="Social:ToggleSidebar" oncommand="Social.toggleSidebar();"/>
|
||||
<command id="Social:ToggleNotifications" oncommand="Social.toggleNotifications();"/>
|
||||
|
@ -513,6 +513,10 @@ let SocialShareButton = {
|
||||
shareButton.hidden = !Social.uiVisible || Social.provider.recommendInfo == null ||
|
||||
!SocialUI.haveLoggedInUser() ||
|
||||
!this.canSharePage(gBrowser.currentURI);
|
||||
// also update the relevent command's disabled state so the keyboard
|
||||
// shortcut only works when available.
|
||||
let cmd = document.getElementById("Social:SharePage");
|
||||
cmd.setAttribute("disabled", shareButton.hidden ? "true" : "false");
|
||||
},
|
||||
|
||||
onClick: function SSB_onClick(aEvent) {
|
||||
|
Loading…
Reference in New Issue
Block a user