From c57436ddf8113ddf6b7428611933b08107d460d0 Mon Sep 17 00:00:00 2001 From: NatureFreshMilk Date: Tue, 14 May 2019 16:03:21 +0200 Subject: [PATCH] use m.render for world info --- server/static/js/WorldInfoDisplay.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/static/js/WorldInfoDisplay.js b/server/static/js/WorldInfoDisplay.js index eac70b6..11262ff 100644 --- a/server/static/js/WorldInfoDisplay.js +++ b/server/static/js/WorldInfoDisplay.js @@ -1,5 +1,9 @@ /* exported WorldInfoDisplay */ +var worldInfoRender = function(info){ + return "Lag: " + parseInt(info.max_lag*10)/10 + " Time: " + parseInt(info.time)/1000; +} + // coord display var WorldInfoDisplay = L.Control.extend({ initialize: function(wsChannel, opts) { @@ -11,7 +15,7 @@ var WorldInfoDisplay = L.Control.extend({ var div = L.DomUtil.create('div', 'leaflet-bar leaflet-custom-display'); this.wsChannel.addListener("minetest-info", function(info){ - div.innerHTML = "Lag: " + parseInt(info.max_lag*10)/10 + " Time: " + parseInt(info.time)/1000; + m.render(div, worldInfoRender(info)) }); return div;