Showing the changes to assets/javascripts/app (2 of 4 files). Show all
Unified · Split
| @@ -14,6 +14,7 @@ class app.Settings · 13 unmodified lines | |||
| 14 | 'tips' | 14 | 'tips' |
| 15 | 'autoInstall' | 15 | 'autoInstall' |
| 16 | 'spaceScroll' | 16 | 'spaceScroll' |
| 17 | 'spaceTimeout' | ||
| 17 | ] | 18 | ] |
| 18 | 19 | ||
| 19 | INTERNAL_KEYS = [ | 20 | INTERNAL_KEYS = [ |
| @@ -35,6 +36,7 @@ class app.Settings · 15 unmodified lines | |||
| 35 | analyticsConsent: false | 36 | analyticsConsent: false |
| 36 | theme: 'auto' | 37 | theme: 'auto' |
| 37 | spaceScroll: 1 | 38 | spaceScroll: 1 |
| 39 | spaceTimeout: 0.5 | ||
| 38 | 40 | ||
| 39 | constructor: -> | 41 | constructor: -> |
| 40 | @store = new CookiesStore | 42 | @store = new CookiesStore |
| @@ -20,11 +20,14 @@ class app.Shortcuts · 19 unmodified lines | |||
| 20 | 20 | ||
| 21 | spaceScroll: -> | 21 | spaceScroll: -> |
| 22 | app.settings.get('spaceScroll') | 22 | app.settings.get('spaceScroll') |
| 23 | 23 | ||
| 24 | showTip: -> | 24 | showTip: -> |
| 25 | app.showTip('KeyNav') | 25 | app.showTip('KeyNav') |
| 26 | @showTip = null | 26 | @showTip = null |
| 27 | 27 | ||
| 28 | spaceTimeout: -> | ||
| 29 | app.settings.get('spaceTimeout') | ||
| 30 | |||
| 28 | onKeydown: (event) => | 31 | onKeydown: (event) => |
| 29 | return if @buggyEvent(event) | 32 | return if @buggyEvent(event) |
| 30 | result = if event.ctrlKey or event.metaKey | 33 | result = if event.ctrlKey or event.metaKey |
| @@ -62,7 +65,7 @@ class app.Shortcuts · 31 unmodified lines | |||
| 62 | @trigger 'escape' | 65 | @trigger 'escape' |
| 63 | false | 66 | false |
| 64 | when 32 | 67 | when 32 |
| 65 | if event.target.type is 'search' and @spaceScroll() and (not @lastKeypress or @lastKeypress < Date.now() - 500) | 68 | if event.target.type is 'search' and @spaceScroll() and (not @lastKeypress or @lastKeypress < Date.now() - (@spaceTimeout() * 1000)) |
| 66 | @trigger 'pageDown' | 69 | @trigger 'pageDown' |
| 67 | false | 70 | false |
| 68 | when 33 | 71 | when 33 |