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

View File

@ -615,9 +615,12 @@ nav =
if i is -1 if i is -1
window.scrollTo 0, 0 window.scrollTo 0, 0
return return
if i is nav.threads.length if delta is +1
window.location = "#{g.PAGENUM + 1}#p0" # if we're at the last thread, or we're at the bottom of the page.
return # 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() {top} = nav.threads[i].getBoundingClientRect()
window.scrollBy 0, top window.scrollBy 0, top