change the callback from resuming from idle, so it starts a short refresh timeout as if the map had just moved

this way, if you switch back to IITC, then quickly move/zoom (as often is done), unnecessary network requests are avoided
because of the change, there's no need for chat to have it's own resume hook - it already hooks into the refresh code and this is now triggered quickly
This commit is contained in:
Jon Atkins 2013-06-15 23:29:16 +01:00
parent b0de73e0ec
commit 0b75b49b98
2 changed files with 1 additions and 3 deletions

View File

@ -198,7 +198,7 @@ window.setupMap = function() {
map.on('movestart zoomstart', function() { window.mapRunsUserAction = true; window.requests.abort(); window.startRefreshTimeout(-1); });
map.on('moveend zoomend', function() { window.mapRunsUserAction = false; window.startRefreshTimeout(ON_MOVE_REFRESH*1000); });
window.addResumeFunction(window.requestData);
window.addResumeFunction(function() { window.startRefreshTimeout(ON_MOVE_REFRESH*1000); });
window.requests.addRefreshFunction(window.requestData);
// start the refresh process with a small timeout, so the first data request happens quickly

View File

@ -605,8 +605,6 @@ window.chat.setup = function() {
if(scrollBottom(t) === 0) chat.requestPublic(false);
});
chat.request();
window.addResumeFunction(chat.request);
window.requests.addRefreshFunction(chat.request);
var cls = PLAYER.team === 'ALIENS' ? 'enl' : 'res';