]> _ Git - fluidbook-html5.git/commitdiff
wait #2636 0:50
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Mar 2019 13:38:59 +0000 (14:38 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Mar 2019 13:38:59 +0000 (14:38 +0100)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.slider.js
js/libs/fluidbook/fluidbook.video.js

index 4f337e114bc941f910d95b039c2e49be84b588a2..1a8e0d979006ef21b02021a80b4fff160f0be9f9 100644 (file)
@@ -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);
index 6e199483a6f0897e7be092be6a1975bfa42aa89a..8153cb5462b7ba3b2fb1fa6f2dddcb5ac1cfaef3 100644 (file)
@@ -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) {
index 8de11876c827107b99ec4040eb81562c43e4c438..39f0de8ab1a5ad36ea5fbdefc8c102b1a60a52ff 100644 (file)
@@ -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) {
+
             }
         });
     },