Fixed positioning of balloon tooltips
authorMarcel Werk <burntime@woltlab.com>
Wed, 2 Nov 2011 14:11:25 +0000 (15:11 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 2 Nov 2011 14:11:25 +0000 (15:11 +0100)
wcfsetup/install/files/js/WCF.js

index 248f208bde4d291f2ff27b79e361116e59fe5a86..d4e4e454e36b7d431e8ebb82395bd95e9978c998 100644 (file)
@@ -2708,10 +2708,10 @@ WCF.Effect.BalloonTooltip.prototype = {
                        this._mouseEnterHandler(event);
                }
                
-               if ($(document).width() - event.pageX < this.tooltip.getDimensions().width) {
+               if (event.pageX + 10 + this.tooltip.getDimensions().width >= $(window).width()) {
                        this.tooltip.css({
-                               top: (event.pageY) + "px",
-                               right: ($(document).width() - event.pageX) + "px",
+                               top: (event.pageY + 20) + "px",
+                               right: ($(document).width() - event.pageX - 5) + "px",
                                left: "auto"
                        });
                }