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

Commit

Permalink
Merge branch 'master' of github.com:brave/browser-laptop
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwykoff committed Nov 7, 2016
2 parents 05e248f + 81a6a70 commit 7ae7274
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions js/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class Main extends ImmutableComponent {
this.onFind = this.onFind.bind(this)
this.onFindHide = this.onFindHide.bind(this)
this.checkForTitleMode = debounce(this.checkForTitleMode.bind(this), 20)
this.lastKeyPressed = undefined
}
registerWindowLevelShortcuts () {
// For window level shortcuts that don't work as local shortcuts
Expand All @@ -129,6 +130,8 @@ class Main extends ImmutableComponent {
}
break
}

this.lastKeyPressed = e.which
})
}

Expand All @@ -143,16 +146,20 @@ class Main extends ImmutableComponent {
break
}

e.preventDefault()
// Only show/hide the menu if last key pressed was ALT
// (typing ALT codes should not toggle menu)
if (this.lastKeyPressed === keyCodes.ALT) {
e.preventDefault()

if (getSetting(settings.AUTO_HIDE_MENU)) {
windowActions.toggleMenubarVisible(null)
} else {
if (customTitlebar.menubarSelectedIndex) {
windowActions.setSubmenuSelectedIndex()
windowActions.setContextMenuDetail()
if (getSetting(settings.AUTO_HIDE_MENU)) {
windowActions.toggleMenubarVisible(null)
} else {
windowActions.setSubmenuSelectedIndex([0])
if (customTitlebar.menubarSelectedIndex) {
windowActions.setSubmenuSelectedIndex()
windowActions.setContextMenuDetail()
} else {
windowActions.setSubmenuSelectedIndex([0])
}
}
}
break
Expand Down

0 comments on commit 7ae7274

Please sign in to comment.