mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Only use super + left/right for back/forward navigation on Mac
Closes #529.
This commit is contained in:
parent
bde3a70480
commit
214622b41e
3 changed files with 6 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in a new issue