This commit is contained in:
Mayhem 2013-06-29 18:04:23 +02:00
parent badc11d4c0
commit 573bd6f294
2 changed files with 4 additions and 5 deletions

View File

@ -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

View File

@ -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