}
this.fluidbook.hideUnnecessaryButtons();
}
- }
- ,
+ },
+
+ showBookmark: function () {
+ if (!this.fluidbook.bookmarks.enabled) {
+ return false;
+ }
+ // cf. #3744
+ // If we are in a doublepage, one the last page with a even pages number, we hide the bookmark help
+ if (this.fluidbook.displayOnePage) {
+ return true;
+ }
+
+ if (!this.fluidbook.settings.invertMenuPosition && !this.fluidbook.getButtonsVisibility().next && this.fluidbook.contentlock.getMaxPage() % 2 === 0) {
+ return false;
+ }
+
+ return true;
+ },
bookmarkLabel: function () {
- if (!this.fluidbook.bookmarks.enabled) {
+ if (!this.showBookmark()) {
return '';
}
+
// The bookmark help element is a bit complex because it must be placed in a section of the help overlay that is
// not already used by the icon labels. Since the menu can be either on the left or right, this needs to be taken
// into account. On the first and last pages of the Fluidbook we don't have a left or right page so it might not
html += $('<div class="bookmark-help-label">' + this.fluidbook.l10n.__('add / remove bookmark') + '</div>')[0].outerHTML;
var wrapper = $('<div class="bookmark-help">' + html + '</div>')[0].outerHTML
- if(wrapper===undefined || wrapper==='undefined'){
+ if (wrapper === undefined || wrapper === 'undefined') {
return '';
}
return wrapper;
}
},
getButtonsVisibility: function (page) {
+ if (page === undefined) {
+ page = this.currentPage;
+ }
+
var max = this.contentlock.getMaxPage();
if (this.contentlock.getMaxPage() % 2 === 1 &&
this.settings.mobileNavigationType !== 'portrait' &&
} else {
$("#previous").addClass('hidden');
}
- }
- ,
+ },
updateShadows: function (page, animationDuration) {
if (animationDuration === undefined) {
animationDuration = 0;
showAllButtons: function () {
$("#next,#previous").addClass('help').show();
},
+
setPageNumbers: function () {
$("#pagesnumbers .left").html(this.getPageNumberOfSide('left', true));
$("#pagesnumbers .right").html(this.getPageNumberOfSide('right', true));