added separate toolbar button for double page mode
This commit is contained in:
parent
4db6ff3add
commit
280bb3070c
13 changed files with 206 additions and 190 deletions
|
@ -210,7 +210,7 @@ var ComicBook = (function ($) {
|
|||
*/
|
||||
ComicBook.prototype.renderControls = function () {
|
||||
|
||||
var controls = {};
|
||||
var controls = {}, $toolbar;
|
||||
|
||||
$.each(Handlebars.templates, function (name, template) {
|
||||
|
||||
|
@ -240,9 +240,12 @@ var ComicBook = (function ($) {
|
|||
|
||||
this.controls = controls;
|
||||
|
||||
this.getControl('toolbar')
|
||||
$toolbar = this.getControl('toolbar');
|
||||
$toolbar
|
||||
.find('.manga-' + options.manga).show().end()
|
||||
.find('.manga-' + !options.manga).hide();
|
||||
.find('.manga-' + !options.manga).hide().end()
|
||||
.find('.layout').hide().end().find('.layout-' + options.displayMode).show();
|
||||
|
||||
};
|
||||
|
||||
ComicBook.prototype.getControl = function (control) {
|
||||
|
@ -266,14 +269,13 @@ var ComicBook = (function ($) {
|
|||
|
||||
ComicBook.prototype.toggleLayout = function() {
|
||||
|
||||
var $control = self.getControl('toolbar').find('[data-action=toggleLayout]');
|
||||
var $toolbar = self.getControl('toolbar');
|
||||
var displayMode = (options.displayMode === 'single') ? 'double' : 'single';
|
||||
|
||||
$control.removeClass(options.displayMode);
|
||||
$control.addClass(displayMode);
|
||||
|
||||
options.displayMode = displayMode;
|
||||
|
||||
$toolbar.find('.layout').hide().end().find('.layout-' + options.displayMode).show();
|
||||
|
||||
self.drawPage();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue