--- /dev/null
+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
$(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);
},
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()) {
$(document).one("touchstart", function () {
$this.hideTooltip();
});
- } else {
- $(target).one('mouseout', function () {
- $this.hideTooltip();
- });
}
+ $(target).one('mouseout', function () {
+ $this.hideTooltip();
+ });
+
this.displayTooltip(text);
return false;
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;
}