From: Vincent Vanwaelscappel Date: Mon, 25 Mar 2019 13:38:59 +0000 (+0100) Subject: wait #2636 0:50 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f32998dcf705ac9e1a2664475b172e37c8a7f235;p=fluidbook-html5.git wait #2636 0:50 --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 4f337e11..1a8e0d97 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -30,6 +30,7 @@ Fluidbook.prototype = { this.singleMode = (this.datas.mobileNavigationType === 'portrait'); this.junk = datas.cacheDate; + this.input=new FluidbookInput(this); if (this.datas.landingPage != undefined && this.datas.landingPage != '') { this.landingpage = new FluidbookLandingPage(this); } @@ -51,7 +52,7 @@ Fluidbook.prototype = { this.desktop = new FluidbookDesktop(this); this.share = new FluidbookShare(this); this.firstTransition = true; - if (Modernizr.ftouch) { + if (this.input.hasTouch) { this.touch = new FluidbookTouch(this); } this.background = new FluidbookBackground(this); diff --git a/js/libs/fluidbook/fluidbook.slider.js b/js/libs/fluidbook/fluidbook.slider.js index 6e199483..8153cb54 100644 --- a/js/libs/fluidbook/fluidbook.slider.js +++ b/js/libs/fluidbook/fluidbook.slider.js @@ -51,15 +51,18 @@ FluidbookSlider.prototype = { event.preventDefault(); }); - if (!Modernizr.ftouch) { - $("#slider").on('mouseenter mousemove', function (e) { + $("#slider").on('mouseenter mousemove', function (e) { + if ($this.fluidbook.input.isUsingMouse()) { return $this.hover(e.pageX); - }); + } + }); - $("#slider").on('mouseleave', function () { + $("#slider").on('mouseleave', function () { + if ($this.fluidbook.input.isUsingMouse()) { $("#slider").removeClass('hover'); - }); - } + } + }); + }, hover: function (pageX) { diff --git a/js/libs/fluidbook/fluidbook.video.js b/js/libs/fluidbook/fluidbook.video.js index 8de11876..39f0de8a 100644 --- a/js/libs/fluidbook/fluidbook.video.js +++ b/js/libs/fluidbook/fluidbook.video.js @@ -71,10 +71,6 @@ function FluidbookVideo(fluidbook) { } } } - // if (!Modernizr.ftouch && this.flash) { - // maybe.push('flv'); - // } - this.videoFormats = $.merge(probably, maybe, not); this.preferedFormat = this.videoFormats[0]; @@ -111,8 +107,7 @@ FluidbookVideo.prototype = { //console.log(id + ' player already active. Disposing...'); try { videojs(id).dispose(); - } - catch (exception) { + } catch (exception) { console.warn('Error disposing player #' + id + ' -- ' + exception.message); } } @@ -406,7 +401,7 @@ FluidbookVideo.prototype = { getActivePlayers: function () { var players = []; - if (typeof(videojs) !== "undefined" && Object.keys(videojs.players).length > 0) { + if (typeof (videojs) !== "undefined" && Object.keys(videojs.players).length > 0) { for (var id in videojs.players) { // When videoJS disposes a player, the ID isn't removed // from the list of players but the value will be null @@ -471,8 +466,8 @@ FluidbookVideo.prototype = { try { var player = videojs(id); $this.disposeVideo(player); - }catch (e) { - + } catch (e) { + } }); },