animate only if already visible

This commit is contained in:
byronbest 2019-12-09 09:32:03 -08:00 committed by GitHub
parent 0878bd2ddc
commit 497776c642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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);