From: Alexander Ebert Date: Tue, 23 Aug 2016 15:10:55 +0000 (+0200) Subject: Fixed tooltip flicker X-Git-Tag: 3.0.0_Beta_1~564 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=212ff8db37a0cb4fa283bfc94e0b44191e2d4566;p=GitHub%2FWoltLab%2FWCF.git Fixed tooltip flicker --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/PseudoHeader.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/PseudoHeader.js index c60a5e2fe3..3cf57f472e 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/PseudoHeader.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/PseudoHeader.js @@ -30,7 +30,7 @@ define([], function() { var titleHeight = ~~styles.height.replace(/px$/, ''); if (titleHeight === 0) { // firefox returns garbage for pseudo element height - // https://bugzilla.mozilla.org/show_bug.cgi?id=925694#c7 + // https://bugzilla.mozilla.org/show_bug.cgi?id=925694 titleHeight = element.scrollHeight; element.classList.add('redactorCalcHeight'); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Tooltip.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Tooltip.js index 625779e49c..bfc51d5bfb 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Tooltip.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Tooltip.js @@ -27,6 +27,14 @@ define(['Environment', 'Dom/ChangeListener', 'Ui/Alignment'], function(Environme _tooltip = elCreate('div'); elAttr(_tooltip, 'id', 'balloonTooltip'); _tooltip.classList.add('balloonTooltip'); + _tooltip.addEventListener('transitionend', function () { + if (!_tooltip.classList.contains('active')) { + // reset back to the upper left corner, prevent it from staying outside + // the viewport if the body overflow was previously hidden + _tooltip.style.removeProperty('top'); + _tooltip.style.removeProperty('left'); + } + }); _text = elCreate('span'); elAttr(_text, 'id', 'balloonTooltipText'); @@ -114,11 +122,6 @@ define(['Environment', 'Dom/ChangeListener', 'Ui/Alignment'], function(Environme */ _mouseLeave: function() { _tooltip.classList.remove('active'); - - // reset back to the upper left corner, prevent it from staying outside - // the viewport if the body overflow was previously hidden - _tooltip.style.removeProperty('top'); - _tooltip.style.removeProperty('left'); } }; });