Only use super + left/right for back/forward navigation on Mac

Closes #529.
This commit is contained in:
Thibaut Courouble 2017-02-26 14:46:45 -05:00
parent bde3a70480
commit 214622b41e
3 changed files with 6 additions and 9 deletions

View file

@ -2,7 +2,7 @@ class app.Shortcuts
$.extend @prototype, Events
constructor: ->
@isWindows = $.isWindows()
@isMac = $.isMac()
@start()
start: ->
@ -91,14 +91,14 @@ class app.Shortcuts
when 13
@trigger 'superEnter'
when 37
unless @isWindows
if @isMac
@trigger 'superLeft'
false
when 38
@trigger 'pageTop'
false
when 39
unless @isWindows
if @isMac
@trigger 'superRight'
false
when 40
@ -135,14 +135,14 @@ class app.Shortcuts
when 9
@trigger 'altRight', event
when 37
if @isWindows
unless @isMac
@trigger 'superLeft'
false
when 38
@trigger 'altUp'
false
when 39
if @isWindows
unless @isMac
@trigger 'superRight'
false
when 40

View file

@ -336,9 +336,6 @@ $.popup = (value) ->
window.open value.href or value, '_blank'
return
$.isWindows = ->
navigator.platform?.indexOf('Win') >= 0
$.isMac = ->
navigator.userAgent?.indexOf('Mac') >= 0

View file

@ -1,5 +1,5 @@
ctrlKey = if $.isMac() then 'cmd' else 'ctrl'
navKey = if $.isWindows() then 'alt' else ctrlKey
navKey = if $.isMac() then 'cmd' else 'alt'
app.templates.helpPage = """
<nav class="_toc" role="directory">