Mercurial > hg > batmud > maputils
changeset 1769:57276229a8c8
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 26 Oct 2017 22:20:25 +0300 |
parents | 7db813d0d2a6 |
children | cc59f80b0e78 |
files | tooltip.js |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/tooltip.js Thu Oct 26 21:49:40 2017 +0300 +++ b/tooltip.js Thu Oct 26 22:20:25 2017 +0300 @@ -38,8 +38,8 @@ // Update the tooltip box function utt(e) { - x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX; - y = (document.all) ? window.event.y + document.body.scrollTop : e.pageY; + var x = document.all ? (window.event.x + document.body.scrollLeft) : e.pageX; + var y = document.all ? (window.event.y + document.body.scrollTop) : e.pageY; if (mytt != null) { var winW = 0, winH = 0; @@ -74,7 +74,8 @@ else y += 15; - myx = x; myy = y; + myx = x; + myy = y; mytt.style.left = x + "px"; mytt.style.top = y + "px";