FluidbookInterface.prototype = {
init: function () {
+ var $this = this;
var res = '';
if ($('html').hasClass('ltr')) {
res += this.fluidbook.nav.getLink('interface-previous', '#', 'previous', '', '', '', true);
$(document).on('click', '#next', goNextPage);
$(document).on('click', '#previous', goPreviousPage);
+ $(this.fluidbook).on('fluidbook.resize, fluidbook.resize.orientation', function () {
+ $this.checkHidden();
+ });
+
this.initArrowsVisibilityManagement();
},
+ checkHidden: function () {
+ if (!this.autoHideArrows()) {
+ this.displayInterface();
+ } else {
+ this.resetTimeout();
+ }
+ },
+
+ areArrowsOverlapingPublication: function () {
+ //return true;
+ return $("#fluidbook").get(0).getBoundingClientRect().left < $("#previous").get(0).getBoundingClientRect().width;
+ },
+
autoHideArrows: function () {
- if (!this.fluidbook.resize.reduceHorizontalMargins()) {
+ if (!this.fluidbook.resize.reduceHorizontalMargins() || !this.areArrowsOverlapingPublication()) {
return false;
}
return true;
});
$(this.fluidbook).on('fluidbook.ready', function () {
- $this.resetTimeout();
+ setTimeout(function () {
+ $this.checkHidden();
+ }, 1000);
});
+ this.checkHidden();
},
toggleInterface: function () {
console.log('toogle interface; current : ' + this.interfaceVisible);
- if (this.interfaceVisible) {
+ if (this.interfaceVisible && this.autoHideArrows()) {
return this.hideInterface();
} else {
return this.displayInterface();
}, this.visibleTime);
},
hideInterface: function () {
+ if (!this.autoHideArrows()) {
+ return;
+ }
this.interfaceVisible = false;
if ($("#helpView").is(':visible') || document.activeElement.tagName.toLowerCase() === 'input') {
this.resetTimeout();
FluidbookResize.prototype = {
reduceHorizontalMargins: function () {
- return this.orientation == 'portrait';//&& this.fluidbook.support.isMobile /*&& Modernizr.touch*/;
+ return this.orientation == 'portrait' && this.fluidbook.support.isMobile && Modernizr.touch;
},
setMargins: function () {
this.fluidbook.zoom.resetZoom();
this.fluidbook.pageTransition();
$(this.fluidbook).trigger('fluidbook.resize.orientation', {orientation: this.orientation});
+ if (this.fluidbook.support.android) {
+ setTimeout(function () {
+ $($this.fluidbook).trigger('fluidbook.resize.orientation', {orientation: $this.orientation});
+ }, 1000);
+ setTimeout(function () {
+ $($this.fluidbook).trigger('fluidbook.resize.orientation', {orientation: $this.orientation});
+ }, 2000);
+ }
}
+
+
},
getScreenFluidbookWidth: function () {
return $("#fluidbook").outerWidth() * fluidbook.resize.bookScale;
}
if (!this.fluidbook.nav.menuIsOpen) return false;
- var wh = $(window).height(),
- formHeight = $('#searchForm').height();
- marginTop = marginBottom = Math.min(Math.round(wh * 0.075), 50); // Relative margins with a max of 50
- searchResultsMaxHeight = wh - formHeight - marginTop - marginBottom,
- mainMenuMaxHeight = wh - $('#menuSearch').height() - $('#shareLinks').outerHeight();
+ var wh = $(window).height();
+ var formHeight = $('#searchForm').height();
+ var marginBottom;
+ var marginTop = marginBottom = Math.min(Math.round(wh * 0.075), 50); // Relative margins with a max of 50
+ var searchResultsMaxHeight = wh - formHeight - marginTop - marginBottom;
+ var mainMenuMaxHeight = wh - $('#menuSearch').height() - $('#shareLinks').outerHeight();
// Search results element may not exist when resize is called
if (this.fluidbook.search.menuSearchResults == undefined) {