moved window.scroll to the draw method so that it is always called regardless of the navigation method
This commit is contained in:
parent
727df8891e
commit
a38ff55da0
1 changed files with 5 additions and 3 deletions
|
@ -445,7 +445,7 @@ function ComicBook(id, srcs, opts) {
|
|||
pages[i] = this;
|
||||
loaded.push(i);
|
||||
|
||||
// start to load from the begining if loading started midway
|
||||
// start to load from the beginning if loading started midway
|
||||
if (i === no_pages-1 && loaded.length !== no_pages) {
|
||||
i = -1;
|
||||
}
|
||||
|
@ -458,6 +458,7 @@ function ComicBook(id, srcs, opts) {
|
|||
|
||||
//console.log(loaded[loaded.length-1]);
|
||||
|
||||
// double page mode needs an extra page added to the buffer
|
||||
padding = (options.displayMode === "double") ? 1 : 0;
|
||||
|
||||
// start rendering the comic when the buffer level has been reached (FIXME: buggy, fails if trying to load the last couple of pages)
|
||||
|
@ -606,6 +607,9 @@ function ComicBook(id, srcs, opts) {
|
|||
if (getHash() !== pointer) {
|
||||
setHash(pointer + 1);
|
||||
}
|
||||
|
||||
// make sure the top of the page is in view
|
||||
window.scroll(0, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -778,8 +782,6 @@ function ComicBook(id, srcs, opts) {
|
|||
|
||||
e.stopPropagation();
|
||||
|
||||
window.scroll(0, 0); // make sure the top of the page is in view
|
||||
|
||||
// western style (left to right)
|
||||
if (!options.manga) {
|
||||
if (side === "left") { ComicBook.prototype.drawPrevPage(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue