From: Vincent Vanwaelscappel Date: Fri, 29 Mar 2019 19:09:58 +0000 (+0100) Subject: wip #2657 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6c3a11db9455f19546e7fcfa6c6997e81898e3ab;p=fluidbook-html5.git wip #2657 @2 --- diff --git a/js/libs/fluidbook/fluidbook.desktop.js b/js/libs/fluidbook/fluidbook.desktop.js index 12124e1f..961953ad 100644 --- a/js/libs/fluidbook/fluidbook.desktop.js +++ b/js/libs/fluidbook/fluidbook.desktop.js @@ -25,10 +25,11 @@ FluidbookDesktop.prototype = { e.stopPropagation(); }) - $(document).on('mousewheel', function (e) { - $this.wheelZoom(e.deltaY); - }) - + if (!this.fluidbook.mobilefirst.enabled) { + $(document).on('mousewheel', function (e) { + $this.wheelZoom(e.deltaY); + }); + } $(document).on('mousemove', 'body', function (e) { $this.moveZoom(e); diff --git a/js/libs/fluidbook/fluidbook.help.js b/js/libs/fluidbook/fluidbook.help.js index 2b80b5c7..7c0295f2 100644 --- a/js/libs/fluidbook/fluidbook.help.js +++ b/js/libs/fluidbook/fluidbook.help.js @@ -229,17 +229,19 @@ FluidbookHelp.prototype = { this.view.find('.next, .last').css(nextPosition); // Slider label - var positionSliderLabel = function () { - var sliderHelp = $this.view.find('.slider'); - var sliderCursor = $('#slidercursor .visible'); - sliderHelp.css({ - bottom: Math.round(hh - sliderCursor.offset().top), - left: Math.round(sliderCursor.offset().left + (sliderCursor.width() / 2)), - transformOrigin: 'left bottom' - }); - }; - positionSliderLabel(); // Run immediately - setTimeout(positionSliderLabel, 250); // delay slightly to make sure co-ordinates are correct + if ($("#slider").length > 0) { + var positionSliderLabel = function () { + var sliderHelp = $this.view.find('.slider'); + var sliderCursor = $('#slidercursor .visible'); + sliderHelp.css({ + bottom: Math.round(hh - sliderCursor.offset().top), + left: Math.round(sliderCursor.offset().left + (sliderCursor.width() / 2)), + transformOrigin: 'left bottom' + }); + }; + positionSliderLabel(); // Run immediately + setTimeout(positionSliderLabel, 250); // delay slightly to make sure co-ordinates are correct + } this.view.find('#icons').css({ top: menuHeightScaled, diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 644d1153..38b6330a 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -254,7 +254,9 @@ Fluidbook.prototype = { this.nav = new FluidbookNav(this); this.interface = new FluidbookInterface(this); - this.slider = new FluidbookSlider(this); + if (!this.mobilefirst.enabled) { + this.slider = new FluidbookSlider(this); + } this.help = new FluidbookHelp(this); this.help.displayAtStartup(); diff --git a/js/libs/fluidbook/fluidbook.resize.js b/js/libs/fluidbook/fluidbook.resize.js index ce869c83..9ba72422 100644 --- a/js/libs/fluidbook/fluidbook.resize.js +++ b/js/libs/fluidbook/fluidbook.resize.js @@ -400,7 +400,6 @@ FluidbookResize.prototype = { var changeOrientation = forceChange || this.orientation !== newo; - var force = this.fluidbook.datas.mobileNavigationType != 'book'; this.orientation = newo; diff --git a/js/libs/fluidbook/fluidbook.support.js b/js/libs/fluidbook/fluidbook.support.js index c46d56ed..e8124933 100644 --- a/js/libs/fluidbook/fluidbook.support.js +++ b/js/libs/fluidbook/fluidbook.support.js @@ -157,7 +157,7 @@ FluidbookSupport.prototype = { }, getOrientation: function () { try { - if (this.fluidbook.pad && this.fluidbook.pad.enabled) { + if ((this.fluidbook.pad && this.fluidbook.pad.enabled) || this.fluidbook.mobilefirst.enabled) { return 0; } else if (this.fluidbook.datas.mobileNavigationType === 'landscape') { return 90; diff --git a/style/fluidbook.less b/style/fluidbook.less index 7ecc7258..89f35d0b 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -686,6 +686,10 @@ body, html { text-align: center; display: inline-block; } + + .mobilefirst & { + display: none; + } } .portrait #pagesnumbers .right {