]> git.joonet.de Git - adminer.git/commitdiff
Fix help position after scroll
authorJakub Vrana <jakub@vrana.cz>
Fri, 21 Feb 2014 17:54:04 +0000 (09:54 -0800)
committerJakub Vrana <jakub@vrana.cz>
Fri, 21 Feb 2014 17:54:04 +0000 (09:54 -0800)
adminer/static/editing.js

index 5a489743d3222f7eb6b753e32b9d0612be5356ae..ac5a08b21c7abc37a998112d308d532fda39a214 100644 (file)
@@ -584,8 +584,9 @@ function helpMouseover(el, event, text, side) {
                jush.highlight_tag([ help ]);
                alterClass(help, 'hidden');
                var rect = target.getBoundingClientRect();
-               help.style.top = (rect.top - (side ? (help.offsetHeight - target.offsetHeight) / 2 : help.offsetHeight)) + 'px';
-               help.style.left = (rect.left - (side ? help.offsetWidth : (help.offsetWidth - target.offsetWidth) / 2)) + 'px';
+               var body = document.documentElement;
+               help.style.top = (body.scrollTop + rect.top - (side ? (help.offsetHeight - target.offsetHeight) / 2 : help.offsetHeight)) + 'px';
+               help.style.left = (body.scrollLeft + rect.left - (side ? help.offsetWidth : (help.offsetWidth - target.offsetWidth) / 2)) + 'px';
        }
 }