From 497776c642395e4c69107b2e8c3be9cf6493e0dd Mon Sep 17 00:00:00 2001 From: byronbest <43890914+byronbest@users.noreply.github.com> Date: Mon, 9 Dec 2019 09:32:03 -0800 Subject: [PATCH] animate only if already visible --- public_html/script.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public_html/script.js b/public_html/script.js index be9c82c..bdac922 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -1133,8 +1133,12 @@ function refreshHighlighted() { if (y > mapCanvas.height() - h) { y -= h; } + if (infoBox.css('visibility', 'visible')) { + infoBox.animate({ left: x, top: y }, 500); + } else { + infoBox.css({ left: x, top: y }, 500); + } infoBox.fadeIn(100); - infoBox.animate({ left: x, top: y }, 500); if (highlighted.flight !== null && highlighted.flight !== "") { $('#highlighted_callsign').text(highlighted.flight);