mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 05:05:16 +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