Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Remove extra separator menu item (doesn't show on Mac)
Browse files Browse the repository at this point in the history
Fixes #3666

Auditors: @charbelrami @srirambv

Test Plan:
- With new code in place, launch Brave on Windows
- Delete all your bookmarks
- Confirm bookmarks menu looks good (no extra separator)
- Go to google.com
- Right click the "Google Search" button
- Confirm you don't see the extra separator
  • Loading branch information
bsclifton committed Sep 2, 2016
1 parent f95c291 commit 0f7c39d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
15 changes: 11 additions & 4 deletions app/browser/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ const createHistorySubmenu = (CommonMenu) => {
}

const createBookmarksSubmenu = (CommonMenu) => {
return [
let submenu = [
{
label: locale.translation('bookmarkPage'),
type: 'checkbox',
Expand All @@ -386,9 +386,16 @@ const createBookmarksSubmenu = (CommonMenu) => {
CommonMenu.bookmarksManagerMenuItem(),
CommonMenu.bookmarksToolbarMenuItem(),
CommonMenu.separatorMenuItem,
CommonMenu.importBookmarksMenuItem(),
CommonMenu.separatorMenuItem
].concat(menuUtil.createBookmarkMenuItems())
CommonMenu.importBookmarksMenuItem()
]

const bookmarks = menuUtil.createBookmarkMenuItems()
if (bookmarks.length > 0) {
submenu.push(CommonMenu.separatorMenuItem)
submenu = submenu.concat(bookmarks)
}

return submenu
}

const createWindowSubmenu = (CommonMenu) => {
Expand Down
6 changes: 5 additions & 1 deletion js/contextMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,11 @@ function mainTemplateInit (nodeProps, frame) {
label: locale.translation('redo'),
accelerator: 'Shift+CmdOrCtrl+Z',
role: 'redo'
}, CommonMenu.separatorMenuItem, ...editableItems, CommonMenu.separatorMenuItem)
}, CommonMenu.separatorMenuItem)

if (editableItems.length > 0) {
template.push(...editableItems, CommonMenu.separatorMenuItem)
}
} else if (isTextSelected) {
if (isDarwin) {
template.push(showDefinitionMenuItem(nodeProps.selectionText),
Expand Down

0 comments on commit 0f7c39d

Please sign in to comment.