From bd786bd6bb8e3b50c652a2a4cb9366fd60dba41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Fri, 18 Feb 2022 12:44:21 +0100 Subject: [PATCH] =?UTF-8?q?R=C3=A9cup=C3=A9ration=20extra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/vendor/tippy/init.js | 81 ++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 35 deletions(-) diff --git a/core/vendor/tippy/init.js b/core/vendor/tippy/init.js index 976da1e6..210a5f14 100755 --- a/core/vendor/tippy/init.js +++ b/core/vendor/tippy/init.js @@ -1,38 +1,49 @@ /** * Initialisation de Tippy */ -$(document).ready(function() { - // Tooltip des aides - tippy(".helpButton", { - arrow: true, - arrowType: "round", - placement: "top" - }); - // Tooltip des attributs title - tippy("[data-tippy-content]", { - arrow: true, - placement: "top" - }); - // Pour les images map, pas de flèche, bulle haut suivant le curseur - - tippy('img[title], a[title], area[title]', { - - content(reference) { - const title = reference.getAttribute('title') - reference.removeAttribute('title') - return title - }, - - placement: "top", - followCursor: true, - animation: "fade", - animateFill: true - }); - // Pour les images map, pas de flèche, bulle haut suivant le curseur - tippy("#image-map", { - placement: "top", - followCursor: true, - animation: "fade", - animateFill: true - }); -}); +$(document).ready(function () { + + // Tooltip des attributs title + tippy("[data-tippy-content]", { + arrow: true, + placement: "top" + }); + + // Pour les images map, pas de flèche, bulle haut suivant le curseur + tippy('img[title], a[title]:not(.button), area[title]', { + + content(reference) { + const title = reference.getAttribute('title') + reference.removeAttribute('title') + return title + }, + + placement: "top", + followCursor: true, + animation: "fade", + animateFill: true + }); + + // Tooltip des aides + tippy('a.button[title]', { + content(reference) { + const title = reference.getAttribute('title') + reference.removeAttribute('title') + return title + }, + delay: [1000,250], + placement: "bottom", + followCursor: false, + arrow: true, + animateFill: true, + arrowType: "round", + }); + + // Pour les images map, pas de flèche, bulle haut suivant le curseur + tippy("#image-map", { + placement: "top", + followCursor: true, + animation: "fade", + animateFill: true + }); +}); \ No newline at end of file