a few slight mods after jslint
This commit is contained in:
parent
c3a0f866cc
commit
48bddd7aa7
1 changed files with 8 additions and 7 deletions
13
ComicBook.js
13
ComicBook.js
|
@ -1,4 +1,5 @@
|
||||||
/*jslint on: true, eqeqeq: true */
|
/*jslint browser: true, on: true, eqeqeq: true, plusplus: true, newcap: true, immed: true */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TODOs:
|
TODOs:
|
||||||
|
|
||||||
|
@ -19,7 +20,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merge two arrays. Any properties in b will replace the same properties in
|
* Merge two arrays. Any properties in b will replace the same properties in
|
||||||
* a. New properties from b will be added to a.
|
* a. New properties from b will be added to a.
|
||||||
|
@ -160,6 +160,7 @@ function ComicBook(id, srcs, opts) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// manually trigger the first load
|
||||||
if (i === 0) { preload(i); }
|
if (i === 0) { preload(i); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -198,12 +199,12 @@ function ComicBook(id, srcs, opts) {
|
||||||
switch(options.zoomMode) {
|
switch(options.zoomMode) {
|
||||||
|
|
||||||
case "manual":
|
case "manual":
|
||||||
document.body.style.overflowX = "auto"
|
document.body.style.overflowX = "auto";
|
||||||
zoom_scale = (options.displayMode === "double") ? scale * 2 : scale;
|
zoom_scale = (options.displayMode === "double") ? scale * 2 : scale;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "fitWidth":
|
case "fitWidth":
|
||||||
document.body.style.overflowX = "hidden"
|
document.body.style.overflowX = "hidden";
|
||||||
zoom_scale = (window.innerWidth > width) ? ((window.innerWidth - width) / window.innerWidth) + 1 // scale up if the window is wider than the page
|
zoom_scale = (window.innerWidth > width) ? ((window.innerWidth - width) / window.innerWidth) + 1 // scale up if the window is wider than the page
|
||||||
: window.innerWidth / width; // scale down if the window is narrower than the page
|
: window.innerWidth / width; // scale down if the window is narrower than the page
|
||||||
break;
|
break;
|
||||||
|
@ -258,7 +259,7 @@ function ComicBook(id, srcs, opts) {
|
||||||
*/
|
*/
|
||||||
ComicBook.prototype.drawNextPage = function () {
|
ComicBook.prototype.drawNextPage = function () {
|
||||||
if (pointer + 1 < pages.length) {
|
if (pointer + 1 < pages.length) {
|
||||||
pointer++;
|
pointer += 1;
|
||||||
this.drawPage();
|
this.drawPage();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -270,7 +271,7 @@ function ComicBook(id, srcs, opts) {
|
||||||
*/
|
*/
|
||||||
ComicBook.prototype.drawPrevPage = function () {
|
ComicBook.prototype.drawPrevPage = function () {
|
||||||
if (pointer > 0) {
|
if (pointer > 0) {
|
||||||
pointer--;
|
pointer -= 1;
|
||||||
this.drawPage();
|
this.drawPage();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue