mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 11:15:21 +01:00
Prevent updating map while invisible
This commit is contained in:
parent
490948a5ed
commit
ce34a4db84
@ -636,6 +636,11 @@ DynMap.prototype = {
|
||||
update: function() {
|
||||
var me = this;
|
||||
|
||||
if (document.visibilityState === "hidden") {
|
||||
setTimeout(function() { me.update(); }, me.options.updaterate);
|
||||
return;
|
||||
}
|
||||
|
||||
$(me).trigger('worldupdating');
|
||||
$.getJSON(me.formatUrl('update', { world: me.world.name, timestamp: me.lasttimestamp, reqid: me.reqid }), function(update) {
|
||||
me.reqid++; // Bump request ID always
|
||||
|
Loading…
Reference in New Issue
Block a user