Fixed invisible tooltip being outside of viewport
authorAlexander Ebert <ebert@woltlab.com>
Tue, 23 Aug 2016 14:46:50 +0000 (16:46 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 23 Aug 2016 14:46:57 +0000 (16:46 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Tooltip.js
wcfsetup/install/files/style/ui/tooltip.scss

index e5ad33f701cb9f022e9800ef8615327febaeb575..625779e49c203c0ffd811ccb42cf1ee242a6ecf8 100644 (file)
@@ -114,6 +114,11 @@ 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');
                }
        };
 });
index fcfb7b658755f16dee7ef38375a97e75f7d6c386..61e7fcf93a177ea83be6b7081a30d8c76d261e7e 100644 (file)
@@ -3,6 +3,7 @@
        border-radius: 2px;
        box-shadow: 0 0 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
        color: $wcfTooltipText;
+       left: 0;
        max-width: 300px;
        padding: 5px 10px;
        pointer-events: none;