From 57e67301eb414ce22188d33e9a91bbee3e63bd12 Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Mon, 19 Aug 2013 23:09:31 +0200 Subject: [PATCH] manga mode toolbar button --- lib/ComicBook.js | 11 +++++++++++ lib/templates.js | 2 +- templates/toolbar.handlebars | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/ComicBook.js b/lib/ComicBook.js index 66b7e44..b9c6525 100755 --- a/lib/ComicBook.js +++ b/lib/ComicBook.js @@ -239,6 +239,10 @@ var ComicBook = (function ($) { }); this.controls = controls; + + this.getControl('toolbar') + .find('.manga-' + options.manga).show().end() + .find('.manga-' + !options.manga).hide(); }; ComicBook.prototype.getControl = function (control) { @@ -835,6 +839,13 @@ var ComicBook = (function ($) { } }; + ComicBook.prototype.toggleReadingMode = function () { + options.manga = !options.manga; + self.getControl('toolbar') + .find('.manga-' + options.manga).show().end() + .find('.manga-' + !options.manga).hide(); + }; + ComicBook.prototype.destroy = function () { $.each(this.controls, function (name, $control) { diff --git a/lib/templates.js b/lib/templates.js index beec511..a8e211a 100644 --- a/lib/templates.js +++ b/lib/templates.js @@ -38,6 +38,6 @@ helpers = helpers || Handlebars.helpers; data = data || {}; - return "\n
\n\n \n\n \n\n
\n"; + return "\n
\n\n \n\n \n\n
\n"; }); })(); \ No newline at end of file diff --git a/templates/toolbar.handlebars b/templates/toolbar.handlebars index e8683f9..fc39b37 100644 --- a/templates/toolbar.handlebars +++ b/templates/toolbar.handlebars @@ -46,6 +46,10 @@
  • +
  • + + +