From dc74ca3b53925770e623afc37f21c0d2214070b2 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 13 Feb 2017 18:41:48 +0100 Subject: [PATCH] fix #1138 @1.5 --- js/libs/fluidbook/fluidbook.tooltip.js | 104 +++++++++++++++---------- js/libs/fluidbook/fluidbook.touch.js | 11 +++ style/fluidbook.css | 6 ++ style/fluidbook.less | 6 ++ 4 files changed, 88 insertions(+), 39 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.tooltip.js b/js/libs/fluidbook/fluidbook.tooltip.js index 3ad2bebb..1c5619e8 100644 --- a/js/libs/fluidbook/fluidbook.tooltip.js +++ b/js/libs/fluidbook/fluidbook.tooltip.js @@ -1,5 +1,6 @@ function FluidbookTooltip(fluidbook) { this.fluidbook = fluidbook; + this.displaying = false; this.init(); } @@ -7,51 +8,76 @@ FluidbookTooltip.prototype = { init: function () { var $this = this; - $(document).on('mouseover', 'a[data-tooltip]', function () { - if (Modernizr.ftouch && !$(this).is("[data-tooltip-touch]")) { - return true; - } - var maxWidth = 140; - if ($(this).data('tooltip-maxwidth') !== null) { - maxWidth = $(this).data('tooltip-maxwidth'); - } - - maxWidth *= 1.28; - maxWidth = Math.round(maxWidth); - - var position = $(this).offset(); - position.top += $(this).outerHeight() + 20; - - var text = $(this).data('tooltip'); - text = $('