Commit af7e4129360b36c2646ff7a736b53c73d5709ee6
Merge pull request #236 from christianbundy/fix-scroll-error
Fix keyboard shortcut scroll errormix irving authored on 8/22/2018, 2:52:38 AM
GitHub committed on 8/22/2018, 2:52:38 AM
Parent: 916d4ff5d00c6cf2d987b6d189c741735eb4c674
Parent: d9e268251876a3e489efb98d379e2bc3a363bab1
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