Skip to content

Commit

Permalink
Fix help position after scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed Feb 21, 2014
1 parent 1088cc5 commit 2b78d06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions adminer/static/editing.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -584,8 +584,9 @@ function helpMouseover(el, event, text, side) {
jush.highlight_tag([ help ]); jush.highlight_tag([ help ]);
alterClass(help, 'hidden'); alterClass(help, 'hidden');
var rect = target.getBoundingClientRect(); var rect = target.getBoundingClientRect();
help.style.top = (rect.top - (side ? (help.offsetHeight - target.offsetHeight) / 2 : help.offsetHeight)) + 'px'; var body = document.documentElement;
help.style.left = (rect.left - (side ? help.offsetWidth : (help.offsetWidth - target.offsetWidth) / 2)) + 'px'; 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';
} }
} }


Expand Down

0 comments on commit 2b78d06

Please sign in to comment.