Skip to content

Commit c2e45f9

Browse files
committed
fix loading spinner
1 parent 3df34c2 commit c2e45f9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

js/tracker.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3491,7 +3491,7 @@ function refresh() {
34913491
refreshSingle(wvar.query);
34923492
} else {
34933493
response = formatData(data, false);
3494-
update(response);
3494+
update(response, true);
34953495
$("#stTimer").attr("data-timestamp", response.fetch_timestamp);
34963496
}
34973497
$("#stText").text("");
@@ -3619,7 +3619,7 @@ function refreshSingle(serial) {
36193619
dataType: "json",
36203620
success: function(data, textStatus) {
36213621
response = formatData(data, false);
3622-
update(response);
3622+
update(response, true);
36233623
singleRecovery(serial);
36243624
$("#stText").text("");
36253625
},
@@ -3661,7 +3661,7 @@ function refreshSingleNew(serial) {
36613661
dataType: "json",
36623662
success: function(data, textStatus) {
36633663
response = formatData(data, false);
3664-
update(response);
3664+
update(response, true);
36653665
},
36663666
error: function() {
36673667
ajax_inprogress_single_new = false;
@@ -4376,14 +4376,16 @@ var ssdv = {};
43764376
var status = "";
43774377
var bs_idx = 0;
43784378

4379-
function update(response) {
4379+
function update(response, none) {
43804380
if (response === null ||
43814381
!response.positions ||
43824382
!response.positions.position ||
43834383
!response.positions.position.length) {
43844384

43854385
// if no vehicles are found, this will remove the spinner and put a friendly message
4386-
$("#main .empty").html("<span>No vehicles :(</span>");
4386+
if (none) {
4387+
$("#main .empty").html("<span>No vehicles :(</span>");
4388+
}
43874389

43884390
return;
43894391
}

0 commit comments

Comments
 (0)