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

Closes #529.
pull/570/merge
Thibaut Courouble 8 years ago
parent bde3a70480
commit 214622b41e

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

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

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

Loading…
Cancel
Save