Skip to content

Commit

Permalink
showing nicer loading message for realtime map
Browse files Browse the repository at this point in the history
  • Loading branch information
gka committed Feb 27, 2013
1 parent 9d5a287 commit 046e966
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion plugins/UserCountryMap/.gitignore

This file was deleted.

20 changes: 10 additions & 10 deletions plugins/UserCountryMap/js/realtime-map.js
Expand Up @@ -265,6 +265,7 @@

// hide loading indicator
$('.realTimeMap_overlay img').hide();
$('.realTimeMap_overlay .loading_data').hide();

// store current timestamp
now = new Date().getTime() / 1000;
Expand Down Expand Up @@ -304,21 +305,20 @@
}

if (report.length) {

// filter results without location
report = $.grep(report, function(r) {
return r.latitude !== null;
});
}

// check wether we got any geolocated visits left
if (!report.length) {
$('.realTimeMap_overlay').hide();
$('#RealTimeMap_meta .noDataForReport').show();
return;
} else {
$('#RealTimeMap_meta .noDataForReport').hide();
$('.realTimeMap_overlay').show();
}
// check wether we got any geolocated visits left
if (!report.length) {
$('.realTimeMap_overlay .showing_visits_of').hide();
$('.realTimeMap_overlay .no_data').show();
return;
} else {
$('.realTimeMap_overlay .showing_visits_of').show();
$('.realTimeMap_overlay .no_data').hide();

lastVisits = [].concat(report).concat(lastVisits).slice(0, maxVisits);
oldest = lastVisits[lastVisits.length-1].lastActionTimestamp;
Expand Down

0 comments on commit 046e966

Please sign in to comment.