From e83dd1e8753facdc83991ce3c147a22be60de2b5 Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Mon, 19 Aug 2013 22:49:11 +0200 Subject: [PATCH] fixed manga mode --- lib/ComicBook.js | 24 +++++++++++++++++++----- lib/templates.js | 4 ++-- templates/navigateLeft.handlebars | 2 +- templates/navigateRight.handlebars | 2 +- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/lib/ComicBook.js b/lib/ComicBook.js index 70a8505..66b7e44 100755 --- a/lib/ComicBook.js +++ b/lib/ComicBook.js @@ -6,7 +6,6 @@ Fo sho: - create onclose callback, show close button only if set - fix progress bar css - - fix manga mode - trigger preload if requesting valid but not loaded images (can happen if network was interupted) - loading and generally hackiness of pointer is buggy, fix. - check for html5 feature support where used: diveintohtml5.org/everything.html or www.modernizr.com @@ -23,6 +22,7 @@ - use custom event emitters instead of hacky code - properly bind 'this' so we don't have to keep using 'self' - allow toolbar to be hidden on mobile (maybe show a small translucent button that opens the toolbar when clicked) + - enhancement progress bar */ var ComicBook = (function ($) { @@ -567,13 +567,23 @@ var ComicBook = (function ($) { // disable prev/next buttons if not needed $('.navigate').show(); if (pointer === 0) { - $('.navigate-left').hide(); - $('.navigate-right').show(); + if (options.manga) { + $('.navigate-left').show(); + $('.navigate-right').hide(); + } else { + $('.navigate-left').hide(); + $('.navigate-right').show(); + } } if (pointer === srcs.length-1 || (typeof page2 === 'object' && pointer === srcs.length-2)) { - $('.navigate-left').show(); - $('.navigate-right').hide(); + if (options.manga) { + $('.navigate-left').hide(); + $('.navigate-right').show(); + } else { + $('.navigate-left').show(); + $('.navigate-right').hide(); + } } if (pointer !== getHash()){ @@ -783,6 +793,10 @@ var ComicBook = (function ($) { switch (e.type) { + case 'click': + side = e.currentTarget.getAttribute('data-navigate-side'); + break; + case 'keydown': // navigation diff --git a/lib/templates.js b/lib/templates.js index db099c3..beec511 100644 --- a/lib/templates.js +++ b/lib/templates.js @@ -14,7 +14,7 @@ helpers = helpers || Handlebars.helpers; data = data || {}; - return "\n
\n \n
\n"; + return "\n
\n \n
\n"; }); templates['navigateRight'] = template(function (Handlebars,depth0,helpers,partials,data) { this.compilerInfo = [2,'>= 1.0.0-rc.3']; @@ -22,7 +22,7 @@ helpers = helpers || Handlebars.helpers; data = data || {}; - return "\n
\n \n
\n"; + return "\n
\n \n
\n"; }); templates['progressbar'] = template(function (Handlebars,depth0,helpers,partials,data) { this.compilerInfo = [2,'>= 1.0.0-rc.3']; diff --git a/templates/navigateLeft.handlebars b/templates/navigateLeft.handlebars index 74ff757..aeb2883 100644 --- a/templates/navigateLeft.handlebars +++ b/templates/navigateLeft.handlebars @@ -1,4 +1,4 @@ -