Skip to content

Commit a7748b2

Browse files
reload predictions with clean_refresh()
1 parent 9b5b440 commit a7748b2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

js/tracker.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ function clean_refresh(text, force) {
368368

369369
lhash_update();
370370
refresh();
371+
refreshPredictions();
371372

372373
return true;
373374
}
@@ -2286,10 +2287,13 @@ function refreshReceivers() {
22862287
});
22872288
}
22882289

2290+
var ajax_predictions = null;
2291+
22892292
function refreshPredictions() {
22902293
//if(typeof _gaq == 'object') _gaq.push(['_trackEvent', 'ajax', 'refresh', 'Predictions']);
2294+
clearTimeout(periodical_predictions);
22912295

2292-
$.ajax({
2296+
ajax_predictions = $.ajax({
22932297
type: "GET",
22942298
url: predictions_url,
22952299
data: "",
@@ -2301,6 +2305,7 @@ function refreshPredictions() {
23012305
error: function() {
23022306
},
23032307
complete: function(request, textStatus) {
2308+
clearTimeout(periodical_predictions);
23042309
periodical_predictions = setTimeout(refreshPredictions, 60 * 1000);
23052310
}
23062311
});
@@ -2471,6 +2476,9 @@ function stopAjax() {
24712476
// stop our timed ajax
24722477
clearTimeout(periodical);
24732478
if(ajax_positions) ajax_positions.abort();
2479+
2480+
clearTimeout(periodical_predictions);
2481+
if(ajax_predictions) ajax_predictions.abort();
24742482
}
24752483

24762484
var currentPosition = null;

0 commit comments

Comments
 (0)