]> _ Git - fluidbook-html5.git/commitdiff
wait #2636 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Mar 2019 12:34:14 +0000 (13:34 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Mar 2019 12:34:14 +0000 (13:34 +0100)
js/libs/fluidbook/fluidbook.input.js [new file with mode: 0644]
js/libs/fluidbook/fluidbook.tooltip.js
style/fluidbook.less

diff --git a/js/libs/fluidbook/fluidbook.input.js b/js/libs/fluidbook/fluidbook.input.js
new file mode 100644 (file)
index 0000000..f47571e
--- /dev/null
@@ -0,0 +1,42 @@
+function FluidbookInput(fluidbook) {
+    this.fluidbook = fluidbook;
+    this.usingMouse = false;
+    this.hasMouse = false;
+    this.forceMouse = false;
+    this.usingTouch = false;
+    this.hasTouch = false;
+    this.forceTouch = false;
+    this.init();
+}
+
+FluidbookInput.prototype = {
+    init: function () {
+        if (Modernizr.ftouch) {
+            this.hasTouch = true;
+        } else {
+            this.usingMouse = this.hasMouse = this.forceMouse = true;
+            this.usingTouch = this.hasTouch = this.forceTouch = false;
+            return;
+        }
+
+        if (Modernizr.iOS || Modernizr.android) {
+            this.usingTouch = this.hasTouch = this.forceTouch = true;
+            this.usingMouse = this.hasMouse = this.forceMouse = false;
+            return;
+        }
+
+        this.forceTouch = this.forceMouse = false;
+
+        $(document).on('mousemove', function () {
+            this.hasMouse = this.usingMouse = true;
+            this.usingTouch = false;
+            return true;
+        });
+
+        $(document).on('touchstart touchmove touchend', function () {
+            this.hasTouch = this.usingTouch = true;
+            this.usingMouse = false;
+            return true;
+        });
+    },
+};
\ No newline at end of file
index 91f34dd847ca11f978fa68a09a4688e35133a2ac..8bdf2d1e95d633b2461988631c3897fcf9a0a37b 100644 (file)
@@ -17,8 +17,7 @@ FluidbookTooltip.prototype = {
         $(window).on('fluidbookzoom', function (e, zoom) {
             $("#tooltip").transform({scale: 1 / zoom}).css({'marginTop': 20 / zoom, 'marginLeft': -10 / zoom});
         });
-
-
+        
         $(document).on('mouseover', 'a[data-tooltip]', function (e) {
             $this.updateMousePosition(e);
             $this.eventTriggered(this);
@@ -74,9 +73,9 @@ FluidbookTooltip.prototype = {
     },
 
     eventTriggered: function (target) {
-        if (Modernizr.ftouch && !$(target).is("[data-tooltip-touch]")) {
-            return true;
-        }
+        // if (Modernizr.ftouch && !$(target).is("[data-tooltip-touch]")) {
+        //     return true;
+        // }
 
         // When the help is open, we don't want tooltips because they are already displayed under the icons
         if (this.fluidbook.help.isVisible()) {
@@ -99,11 +98,11 @@ FluidbookTooltip.prototype = {
             $(document).one("touchstart", function () {
                 $this.hideTooltip();
             });
-        } else {
-            $(target).one('mouseout', function () {
-                $this.hideTooltip();
-            });
         }
+        $(target).one('mouseout', function () {
+            $this.hideTooltip();
+        });
+
 
         this.displayTooltip(text);
         return false;
index 062c6ca61bea123ede320aff7cb6196370abe881..179496ea2789a706a861661821ca40ff4b9f503a 100644 (file)
@@ -1213,14 +1213,11 @@ html.ios body.portrait #interface {
   background-color: transparent;
 
   &.displayArea {
-    -webkit-tap-highlight-color: @links-area-color;
     background-color: fadeout(@links-color, 99.999%);
-
     &.animating {
       background-color: @links-area-color;
     }
-
-    .no-ftouch &:hover {
+    &:hover {
       opacity: 1 !important;
       background-color: @links-area-color;
     }