return offset;
},
goNextPage: function () {
- if (!this.pagetransitions.canChangePage()) {
+ if (!this.canChangePage()) {
return;
}
this.transitionAxis = 'x';
this.setCurrentPage(this.normalizePage(this.currentPage) + this.getNextOffset());
},
goFirstPage: function () {
- if (!this.pagetransitions.canChangePage()) {
+ if (!this.canChangePage()) {
return;
}
this.transitionAxis = 'x';
this.setCurrentPage(1);
},
goPreviousPage: function () {
- if (!this.pagetransitions.canChangePage()) {
+ if (!this.canChangePage()) {
return;
}
this.transitionAxis = 'x';
this.setCurrentPage(this.normalizePage(this.currentPage) - this.getNextOffset());
},
goLastPage: function () {
- if (!this.pagetransitions.canChangePage()) {
+ if (!this.canChangePage()) {
return;
}
this.transitionAxis = 'x';
this.setCurrentPage(this.contentlock.getMaxPage());
},
goNextChapter: function () {
- if (!this.pagetransitions.canChangePage()) {
+ if (!this.canChangePage()) {
return;
}
var next = this.bookmarks.getNextGroupCover(this.currentPage);
this.setCurrentPage(this.normalizePage(next));
},
goPreviousChapter: function () {
- if (!this.pagetransitions.canChangePage()) {
+ if (!this.canChangePage()) {
return;
}
var prev = this.bookmarks.getPreviousGroupCover(this.currentPage);
this.setCurrentPage(this.normalizePage(prev));
},
goNextChapterPage: function () {
- if (!this.pagetransitions.canChangePage()) {
+ if (!this.canChangePage()) {
return;
}
this.setCurrentPage(this.normalizePage(next));
},
goPreviousChapterPage: function () {
- if (!this.pagetransitions.canChangePage()) {
+ if (!this.canChangePage()) {
return;
}
FluidbookSlider.prototype = {
init: function () {
+ var $this = this;
$(document).on('click', function () {
$("#slider").removeClass('drag');
return true;
- })
+ });
+ $(document).on('click', '#sliderthumb a[data-page]', function () {
+ if ($this.fluidbook.canChangePage()) {
+ $this.fluidbook.setCurrentPage(parseInt($(this).attr('data-page')));
+ }
+ return false;
+ });
$("#interface").append('<div id="slider"><div id="sliderthumb"><div class="doubleThumb"><div class="thumb left"><a href="#"><div class="img"></div></a><span class="number"></span><a href="#" class="bookmark left"></a></div><div class="thumb right"><a href="#"><div class="img"></div></a><span class="number"></span><a href="#" class="bookmark right"></a></div></div></div><div id="sliderback"><div class="visible"></div></div><div id="slidercursor"><div class="visible"></div></div></div>');
- var $this = this;
+
$(this.fluidbook).on('fluidbook.page.change.end', function (e, page) {
$this.updateCursorPosition();
});
if (page > 0 && page <= this.fluidbook.contentlock.getMaxPage()) {
thumb.css('visibility', 'visible');
this.fluidbook.loader.getThumbImage(page, thumb.find('.img'), shade);
- thumb.find('a').attr('href', '#/page/' + page);
+ thumb.find('a').attr('href', '#').attr('data-page', page);
thumb.find('.number').text(this.fluidbook.physicalToVirtual(page));
} else {
thumb.css('visibility', 'hidden');