disable page navigation controls when not needed
This commit is contained in:
parent
b235efdbfd
commit
8663e817c3
1 changed files with 14 additions and 2 deletions
|
@ -4,7 +4,6 @@
|
|||
TODOs:
|
||||
|
||||
Fo sho:
|
||||
- improve prev/next buttons, only show them when they can possibly work (not at beginning/end)
|
||||
- more smart image preloading, preload in both directions when a comic is loaded in the middle
|
||||
- fix manga mode
|
||||
- check for html5 feature support where used: diveintohtml5.org/everything.html or www.modernizr.com
|
||||
|
@ -610,7 +609,9 @@ function ComicBook(id, srcs, opts) {
|
|||
|
||||
// draw the page(s)
|
||||
context.drawImage(page, offsetW, offsetH, page_width, page_height);
|
||||
if (options.displayMode === "double" && typeof page2 === "object") { context.drawImage(page2, page_width + offsetW, offsetH, page_width, page_height); }
|
||||
if (options.displayMode === "double" && typeof page2 === "object") {
|
||||
context.drawImage(page2, page_width + offsetW, offsetH, page_width, page_height);
|
||||
}
|
||||
|
||||
// apply any image enhancements previously defined
|
||||
$.each(options.enhance, function(action, options) {
|
||||
|
@ -626,6 +627,17 @@ function ComicBook(id, srcs, opts) {
|
|||
// disable the fit width button if needed
|
||||
$("button.cb-fit-width").attr("disabled", (options.zoomMode === "fitWidth"));
|
||||
|
||||
// disable prev/next buttons if not needed
|
||||
$(".cb-navigate").show();
|
||||
if (pointer === 0) {
|
||||
$(".cb-navigate.left").hide();
|
||||
$(".cb-navigate.right").show();
|
||||
}
|
||||
if (pointer === srcs.length-1) {
|
||||
$(".cb-navigate.left").show();
|
||||
$(".cb-navigate.right").hide();
|
||||
}
|
||||
|
||||
// user callback
|
||||
if (typeof options.afterDrawPage === "function") {
|
||||
options.afterDrawPage(pointer + 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue