Fixed tooltip flicker
authorAlexander Ebert <ebert@woltlab.com>
Tue, 23 Aug 2016 15:10:55 +0000 (17:10 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 23 Aug 2016 15:10:55 +0000 (17:10 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/PseudoHeader.js
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Tooltip.js

index c60a5e2fe3ff9075d519bf691558ace3468afee3..3cf57f472ee0d95332d4884c29b21859b6a91e18 100644 (file)
@@ -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');
index 625779e49c203c0ffd811ccb42cf1ee242a6ecf8..bfc51d5bfb863d4d3a0605720b1376306f94fcea 100644 (file)
@@ -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');
                }
        };
 });