mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-25 23:50:22 +01:00
Fix state switching auto-update/manual refresh.
This commit is contained in:
parent
dda0716053
commit
71636a5b4c
@ -39,8 +39,9 @@ L.Control.AutoUpdate = L.Control.extend({
|
|||||||
|
|
||||||
stopUpdate: function() {
|
stopUpdate: function() {
|
||||||
if (this.socket) {
|
if (this.socket) {
|
||||||
this.socket.close();
|
var s = this.socket;
|
||||||
this.socket = null;
|
this.socket = null;
|
||||||
|
s.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -53,7 +54,9 @@ L.Control.AutoUpdate = L.Control.extend({
|
|||||||
me.switchButtons();
|
me.switchButtons();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.socket.onclose = this.socket.onerror;
|
this.socket.onclose = function(evt) {
|
||||||
|
this.socket = null;
|
||||||
|
}
|
||||||
|
|
||||||
this.socket.onopen = function(evt) {
|
this.socket.onopen = function(evt) {
|
||||||
// Sending pings every 5 secs to keep connection alive.
|
// Sending pings every 5 secs to keep connection alive.
|
||||||
|
Loading…
Reference in New Issue
Block a user