preserve scope

This commit is contained in:
Thomas Rudin 2019-07-19 19:52:19 +02:00
parent 9266c47c1e
commit 1f8109e8b8

View File

@ -180,14 +180,14 @@ export default L.LayerGroup.extend({
},
onAdd: function(/*map*/) {
this.layerMgr.addListener(this.reDraw);
this.wsChannel.addListener("minetest-info", this.onMinetestUpdate);
this.layerMgr.addListener(() => this.reDraw());
this.wsChannel.addListener("minetest-info", () => this.onMinetestUpdate());
this.reDraw();
},
onRemove: function(/*map*/) {
this.clearLayers();
this.layerMgr.removeListener(this.reDraw);
this.wsChannel.removeListener("minetest-info", this.onMinetestUpdate);
this.layerMgr.removeListener(() => this.reDraw());
this.wsChannel.removeListener("minetest-info", () => this.onMinetestUpdate());
}
});