From 84b9ddb9c2da2494a088049651e788262f3addc7 Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@gmail.com> Date: Sat, 22 Feb 2020 22:19:10 +0100 Subject: [PATCH] simplify tooltips toggle --- src/003-assets/CSS/tooltip.css | 4 ++-- src/js/utilsDOM.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/003-assets/CSS/tooltip.css b/src/003-assets/CSS/tooltip.css index 8246aae0c3b..719d9e6bd31 100644 --- a/src/003-assets/CSS/tooltip.css +++ b/src/003-assets/CSS/tooltip.css @@ -58,13 +58,13 @@ z-index: 999; } -body.tooltipsEnabled .exampleTooltip:hover:after, body.tooltipsEnabled .devotion:hover:after, body.tooltipsEnabled .trust:hover:after, body.tooltipsEnabled .defiant:hover:after { +div.tooltipsEnabled .exampleTooltip:hover:after, div.tooltipsEnabled .devotion:hover:after, div.tooltipsEnabled .trust:hover:after, div.tooltipsEnabled .defiant:hover:after { visibility: visible; opacity: 1; bottom: 20px; } -body.tooltipsEnabled .exampleTooltip:hover:before, body.tooltipsEnabled .devotion:hover:before, body.tooltipsEnabled .trust:hover:before, body.tooltipsEnabled .defiant:hover:before { +div.tooltipsEnabled .exampleTooltip:hover:before, div.tooltipsEnabled .devotion:hover:before, div.tooltipsEnabled .trust:hover:before, div.tooltipsEnabled .defiant:hover:before { visibility: visible; opacity: 1; bottom: 15px; diff --git a/src/js/utilsDOM.js b/src/js/utilsDOM.js index 603a38fcb65..9a1469dfc5b 100644 --- a/src/js/utilsDOM.js +++ b/src/js/utilsDOM.js @@ -196,8 +196,8 @@ App.Utils.htmlToElement = function(text) { /* * Shows tooltips if they are enabled. Must be called on every passage load, because <body> gets reset. */ -$(document).on(":passageend", () => { +$(document).on(":passagestart", event => { if (V.tooltipsEnabled === 1) { - document.body.classList.add("tooltipsEnabled"); + event.content.classList.add("tooltipsEnabled"); } }); -- GitLab