From: Vincent Vanwaelscappel Date: Mon, 25 Mar 2019 12:34:14 +0000 (+0100) Subject: wait #2636 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=47b1fe98;p=fluidbook-html5.git wait #2636 @1 --- diff --git a/js/libs/fluidbook/fluidbook.input.js b/js/libs/fluidbook/fluidbook.input.js new file mode 100644 index 00000000..f47571e2 --- /dev/null +++ b/js/libs/fluidbook/fluidbook.input.js @@ -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 diff --git a/js/libs/fluidbook/fluidbook.tooltip.js b/js/libs/fluidbook/fluidbook.tooltip.js index 91f34dd8..8bdf2d1e 100644 --- a/js/libs/fluidbook/fluidbook.tooltip.js +++ b/js/libs/fluidbook/fluidbook.tooltip.js @@ -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; diff --git a/style/fluidbook.less b/style/fluidbook.less index 062c6ca6..179496ea 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -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; }