@page bottom, next thread -> next page

This commit is contained in:
James Campos 2011-04-25 19:06:52 -07:00
parent 4198365ab4
commit dfed85d6d1
2 changed files with 11 additions and 6 deletions

View File

@ -827,9 +827,11 @@
window.scrollTo(0, 0);
return;
}
if (i === nav.threads.length) {
window.location = "" + (g.PAGENUM + 1) + "#p0";
return;
if (delta === +1) {
if (i === nav.threads.length || (innerHeight + pageYOffset === d.body.scrollHeight)) {
window.location = "" + (g.PAGENUM + 1) + "#p0";
return;
}
}
top = nav.threads[i].getBoundingClientRect().top;
return window.scrollBy(0, top);

View File

@ -615,9 +615,12 @@ nav =
if i is -1
window.scrollTo 0, 0
return
if i is nav.threads.length
window.location = "#{g.PAGENUM + 1}#p0"
return
if delta is +1
# if we're at the last thread, or we're at the bottom of the page.
# kind of hackish, what we really need to do is make nav.getThread smarter.
if i is nav.threads.length or (innerHeight + pageYOffset == d.body.scrollHeight)
window.location = "#{g.PAGENUM + 1}#p0"
return
{top} = nav.threads[i].getBoundingClientRect()
window.scrollBy 0, top