Commit d9e268251876a3e489efb98d379e2bc3a363bab1
Fix keyboard shortcut scroll error
Christian Bundy committed on 8/14/2018, 7:12:52 PMParent: ca8ac8d21e58b7d37981f6ee097ce54b1bf10b22
Files changed
app/sync/catch-keyboard-shortcut.js | changed |
app/sync/catch-keyboard-shortcut.js | |||
---|---|---|---|
@@ -43,11 +43,17 @@ | |||
43 | 43 … | } | |
44 | 44 … | } | |
45 | 45 … | ||
46 | 46 … | function genericShortcuts (ev, { tabs, search, goTo, back }) { | |
47 | - const scroll = tabs.currentPage().scroll || noop | ||
47 … | + let scroll | ||
48 … | + const currentPage = tabs.currentPage() | ||
48 | 49 … | // TODO change this scroll API - it seems some pages | |
49 | - // (e.g. Dark Crystal Index has scroll defined and expect an object...) | ||
50 … | + // (e.g. Dark Crystal Index) has scroll defined and expect an object | ||
51 … | + if (currentPage) { | ||
52 … | + scroll = currentPage.scroll | ||
53 … | + } else { | ||
54 … | + scroll = noop | ||
55 … | + } | ||
50 | 56 … | ||
51 | 57 … | // Messages | |
52 | 58 … | if (ev.keyCode === 71) { // gg = scroll to top | |
53 | 59 … | if (!gPressed) { |
Built with git-ssb-web