help += '</div>';
// Interface
- if (this.fluidbook.interface.arrowsEnabled) {
+ if (this.fluidbook.interface.arrowsEnabled()) {
var next = this.fluidbook.l10n.__('next double page');
var previous = this.fluidbook.l10n.__('previous double page');
if (this.fluidbook.pad.enabled) {
}
help += '<div class="interface">';
- if (this.fluidbook.interface.arrowsEnabled) {
+ if (this.fluidbook.interface.arrowsEnabled()) {
help += '<div class="next">' + next + '</div>';
help += '<div class="last">' + this.fluidbook.l10n.__('last page') + '</div>';
help += '<div class="previous">' + previous + '</div>';
var firstTop;
- if (this.fluidbook.interface.arrowsEnabled) {
+ if (this.fluidbook.interface.arrowsEnabled()) {
var arrow = $('#interface #next').get(0).getBoundingClientRect(); // Used for calculating offsets for both #next & #previous
// The arrow element contains both arrows in a single image
// so we calculate the top position of the labels by percentage
this.visibleTime = 5000;
this.interfaceVisible = false;
- this.arrowsEnabled = this.fluidbook.datas.arrowsEnabled;
-
this.maskToggleEventsTimeout = Date.now();
this.init();
init: function () {
var $this = this;
- if (this.arrowsEnabled) {
+ if (this.arrowsEnabled()) {
var res = '';
if ($('html').hasClass('ltr')) {
res += this.fluidbook.nav.getLink('interface-previous', '#', 'previous', '', '', '', true);
});
},
+ arrowsEnabled: function () {
+ switch (this.fluidbook.datas.arrowsEnabled) {
+ case '0':
+ return false;
+ case '1':
+ return true;
+ case '2':
+ return !this.fluidbook.input.hasTouch;
+ default:
+ return true;
+ }
+ },
+
checkHidden: function () {
if (!this.autoHideArrows()) {
this.displayInterface();
},
autoHideArrows: function () {
- var res = this.arrowsEnabled && (this.fluidbook.resize===undefined || this.fluidbook.resize.reduceHorizontalMargins()) && this.areArrowsOverlapingPublication() && ($("#helpView:visible").length === 0);
+ var res = this.arrowsEnabled() && (this.fluidbook.resize === undefined || this.fluidbook.resize.reduceHorizontalMargins()) && this.areArrowsOverlapingPublication() && ($("#helpView:visible").length === 0);
return res;
},
getInterfaceSelector: function () {
var selector = '';
- if (this.arrowsEnabled) {
+ if (this.arrowsEnabled()) {
selector = '#next,#previous'
}
if (this.fluidbook.pad.enabled) {
origin: [right, '100%']
});
- if(this.fluidbook.interface.arrowsEnabled) {
+ if(this.fluidbook.interface.arrowsEnabled()) {
$("#next").transform({
origin: [right, '50%']
});
}
}
- if(this.fluidbook.interface.arrowsEnabled) {
+ if(this.fluidbook.interface.arrowsEnabled()) {
$("#next").transform({
scale: cssInterfaceScale,
});
};
- if(this.fluidbook.interface.arrowsEnabled) {
+ if(this.fluidbook.interface.arrowsEnabled()) {
try {
data.arrowLeftRect = $("#previous").get(0).getBoundingClientRect();
data.arrowRightRect = $("#next").get(0).getBoundingClientRect();
},
resizeNav: function (interfaceScale) {
var $this = this;
- if(this.fluidbook.interface.arrowsEnabled) {
+ if(this.fluidbook.interface.arrowsEnabled()) {
var topNext = (this.hh - (100 * interfaceScale)) / 2;
$("#next,#previous").css({
top: topNext
- });
- $("#next,#previous").show();
+ }).show();
}
- if ($("#afterSearch:visible").length == 1) {
+ if ($("#afterSearch:visible").length === 1) {
setTimeout(function () {
$this.resizeAfterSearch();
}, 10);