Bug 1406051 - Don't show two separators in context menu. r?jaws
MozReview-Commit-ID: H32PX0zh3eU
--- a/browser/base/content/browser-sync.js
+++ b/browser/base/content/browser-sync.js
@@ -460,19 +460,22 @@ var gSync = {
// showSendLink and showSendPage are mutually exclusive
const showSendLink = contextMenu.onSaveableLink || contextMenu.onPlainTextLink;
const showSendPage = !showSendLink
&& !(contextMenu.isContentSelected ||
contextMenu.onImage || contextMenu.onCanvas ||
contextMenu.onVideo || contextMenu.onAudio ||
contextMenu.onLink || contextMenu.onTextInput);
- ["context-sendpagetodevice", "context-sep-sendpagetodevice"]
+ // Avoids double separator on images with links.
+ const hideSeparator = contextMenu.isContentSelected &&
+ contextMenu.onLink && contextMenu.onImage;
+ ["context-sendpagetodevice", ...(hideSeparator ? [] : ["context-sep-sendpagetodevice"])]
.forEach(id => contextMenu.showItem(id, showSendPage));
- ["context-sendlinktodevice", "context-sep-sendlinktodevice"]
+ ["context-sendlinktodevice", ...(hideSeparator ? [] : ["context-sep-sendlinktodevice"])]
.forEach(id => contextMenu.showItem(id, showSendLink));
if (!showSendLink && !showSendPage) {
return;
}
const targetURI = showSendLink ? contextMenu.linkURL :
contextMenu.browser.currentURI.spec;