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:
parent
b0de73e0ec
commit
0b75b49b98
@ -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
|
||||
|
@ -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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user