diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index 7f33b2b74..50177e169 100644 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -75,10 +75,10 @@ Keybinds = window.location = form.action # Thread Navigation when Conf['Next thread'] - return if g.VIEW is 'thread' + return if g.VIEW isnt 'index' Nav.scroll +1 when Conf['Previous thread'] - return if g.VIEW is 'thread' + return if g.VIEW isnt 'index' Nav.scroll -1 when Conf['Expand thread'] ExpandThread.toggle thread diff --git a/src/Miscellaneous/Nav.coffee b/src/Miscellaneous/Nav.coffee index 972f66b3c..2b7e23354 100644 --- a/src/Miscellaneous/Nav.coffee +++ b/src/Miscellaneous/Nav.coffee @@ -60,8 +60,7 @@ Nav = # unless we're not at the beginning of the current thread # (and thus wanting to move to beginning) # or we're above the first thread and don't want to skip it - unless (delta is -1 and Math.ceil(top) < 0) or (delta is +1 and top > 1) - i += delta + if (delta is -1 and top > -5) or (delta is +1 and top < 5) + top = threads[i + delta]?.getBoundingClientRect().top - topMargin - top = threads[i]?.getBoundingClientRect().top - topMargin window.scrollBy 0, top