loleaflet: Fix insertfile after the L.Socket -> this._map.socket change.

This commit is contained in:
Jan Holesovsky 2016-01-18 10:35:46 +01:00
parent 3eeecacfb9
commit dd5a8a7cb4

View file

@ -48,9 +48,10 @@ L.Map.FileInserter = L.Handler.extend({
_sendFile: function (name, file) {
var url = this._url;
var xmlHttp = new XMLHttpRequest();
var socket = this._map._socket;
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState === 4 && xmlHttp.status === 200) {
this._map._socket.sendMessage('insertfile name=' + name + ' type=graphic');
socket.sendMessage('insertfile name=' + name + ' type=graphic');
}
};
xmlHttp.open('POST', url, true);