FluidbookMobileFirst.prototype = {
init: function () {
$("html").addClass('mobilefirst');
+ $("#scroll").append($('#shadow'));
+ $("#shadow .side").remove();
this.fluidbook.datas.soundTheme = '';
},
beforeTransition: function (page) {
var dimensions = this.fluidbook.loader.getPageDimensions(page);
+ $('#pages .mf-nav').css('opacity', 0);
+ var max = Math.max(dimensions.height, $("#currentDoublePage").outerHeight());
$("#nextDoublePage .page, #nextDoublePage").css({
height: dimensions.height,
maxHeight: dimensions.height
});
+ $("#pages,#fluidbook").css({height: max, maxHeight: max});
+
TweenLite.to("#scroll", this.fluidbook.pagetransitions.getTransitionDuration(page), {scrollTo: 0});
},
afterTransition: function (page) {
$('#pages .mf-nav').remove();
$("#pages").append(this.getFooterNavigation(page));
+
+ setTimeout(function () {
+ $('#pages .mf-nav').css('opacity', 1);
+ }, 10);
+
this.fluidbook.resize.resize();
- var $this=this;
- setTimeout(function(){
+ var $this = this;
+ setTimeout(function () {
this.fluidbook.resize.resize();
- },1000);
+ }, 1000);
},
resize: function () {
var bh = $("#currentDoublePage").outerHeight();
$('#pages .mf-nav').css('top', bh);
- var h = bh+$("#pages .mf-nav").outerHeight();
+ $("#links,#searchHighlights,#shadow").css({height: bh});
- $("#links,#searchHighlights").css({height:bh});
+ var h = bh + $("#pages .mf-nav").outerHeight();
$("#pages,#fluidbook").css({height: h});
$("#pages").css('maxHeight', h);
},
hmf.add(new Hammer.Pan({threshold: 0}));
hmf.on('panmove', function (event) {
console.log('panmove');
- $this.drag(event);
- event.preventDefault();
+ if ($this.drag(event)) {
+ event.preventDefault();
+ }
});
hmf.on('panend', function (event) {
console.log('panend');
- $this.drag(event, true);
+ var prevent = $this.drag(event, true);
$this.startX = $this.startY = -1;
$this.panX = $this.panY = 0;
- event.preventDefault();
+ if (prevent) {
+ event.preventDefault();
+ }
});
},
-#shadow {
- .mobilefirst & {
- display: none;
+.mobilefirst {
+ #shadow {
+ box-shadow: rgba(0, 0, 0, @shadow-opacity) 0 0 10px;
+
+ .shadow.bottom {
+ height: 80px;
+ bottom: -80px;
+ background-size: unit(@book-page-width - 10, px) 80px;
+ background-position: 50% 100%;
+ background-repeat: no-repeat;
+ opacity: @shadow-opacity*0.25;
+ }
}
}
color: @page-number-color;
font-size: unit(20*@css-scale, px);
font-weight: 600;
+ transition: opacity 0.25s;
+ opacity: 0;
+
@media @small {
@s: 1.25;
font-size: unit(20*@s*@css-scale, px);