$("#main").css('visibility', 'visible');\r
this.hideLoader(0, true);\r
$("#splash").css('opacity', 0).one(this.support.getTransitionEndEvent(), function() {\r
+ fb('removed splash');\r
$(this).remove();\r
});\r
},\r
pagesWithHits++;\r
}\r
}\r
+ \r
+ if($(this))\r
\r
if ($(this).find('.hits').length > 0) {\r
return;\r
$(this).append('<div class="hits no">' + $this.l10n.__('no result found') + '</div>');\r
} else {\r
$(this).append('<div class="hits yes">' + hitsp + ' ' + $this.l10n.__('hit(s)') + '</div>');\r
- if (pagesWithHits <= 1) {\r
+ if (pagesWithHits <= 2) {\r
$(this).find('a').attr('href', '#/page/' + $(this).attr('page'));\r
} else {\r
$(this).find('a').attr('href', '#/search/' + e + '/' + $(this).attr('page'));\r
init = false;\r
}\r
\r
+ $("#main").hide();\r
+\r
var $this = this;\r
this.updateWindow();\r
this.handleOrientation();\r
var cssInterfaceScale = [interfaceScale, interfaceScale];\r
var cssNavScale = [navScale, navScale];\r
\r
-\r
$("#main").css({\r
width: this.ww,\r
height: this.hh\r
scale: [this.bookScale, this.bookScale],\r
origin: ['50%', '50%']\r
});\r
+ var top = marginTop + (ah - fhh) / 2;\r
+ var left = marginLeft + (aw - fww) / 2;\r
$("#fluidbook").css({\r
- top: marginTop + (ah - fhh) / 2,\r
- left: marginLeft + (aw - fww) / 2,\r
+ top: top,\r
+ left: left,\r
width: fww,\r
height: fhh\r
});\r
\r
\r
- $("#next,#previous").transform({\r
- scale: cssInterfaceScale\r
+ $("#next").transform({\r
+ scale: cssInterfaceScale,\r
+ translateX: 40 * (1 - interfaceScale) + 'px'\r
});\r
\r
+ $("#previous").transform({\r
+ scale: cssInterfaceScale,\r
+ translateX: -40 * (1 - interfaceScale) + 'px'\r
+ })\r
+\r
$("#nav,#logo,footer").transform({\r
scale: navScale\r
});\r
this.resizeNav(interfaceScale);\r
}\r
\r
+\r
+\r
this.resizePopupVideos();\r
this.resizeSplash();\r
+\r
+ $("#main").show();\r
},\r
resizeNav: function(interfaceScale) {\r
var topNext = (this.hh - 100 * interfaceScale) / 2;\r
});\r
},\r
resizeSplash: function() {\r
+ if ($("#splash").length == 0) {\r
+ return;\r
+ }\r
$("#splash").css({\r
width: this.ww,\r
height: this.hh\r
newo = 'landscape';\r
$('body').removeClass('portrait');\r
}\r
-\r
- if (this.orientation == newo) {\r
+ var force = this.fluidbook.datas.mobileNavigationType != 'book';\r
+ if (!force && this.orientation == newo) {\r
return;\r
}\r
this.orientation = newo;\r
return t;
},
initEvents: function() {
+
+ var $this=this;
if (!this.isMobile) {
$(window).resize(function() {
if ("onorientationchange" in window) {
window.addEventListener('orientationchange', function() {
- if (this.iOS) {
+ if ($this.iOS) {
resize();
} else {
resize();
}
}, false);
} else {
- var $this = this;
setInterval(function() {
$this.checkOrientation();
}, 100);
try {
if (this.fluidbook.pad && this.fluidbook.pad.enabled) {
return 0;
+ }else if(this.fluidbook.datas.mobileNavigationType=='landscape'){
+ return 90;
+ }else if(this.fluidbook.datas.mobileNavigationType=='portrait'){
+ return 0;
}
} catch (err) {
}
try {
- var mql = Modernizr.mq("(orientation: portrait)");
- if (mql.matches) {
- return 0;
- } else {
- return 90;
- }
+ return Modernizr.mq("(orientation: portrait)") ? 0 : 90;
} catch (err) {
}
- if ($("#op").is(':visible')) {
- return 0;
- } else {
- return 90;
- }
+ return $("#op").is(':visible') ? 0 : 90;
},
getZoomLevel: function() {
var tzoom = DetectZoom.zoom();