loleaflet: enable drop of images

This commit is contained in:
Miklos Vajna 2016-01-18 14:37:37 +01:00
parent bcf0e2d81f
commit 8845679d2f

View file

@ -972,16 +972,16 @@ L.TileLayer = L.GridLayer.extend({
for (var i = 0; i < files.length; ++i) { for (var i = 0; i < files.length; ++i) {
var file = files[i]; var file = files[i];
if (file.type.match(/image.*/)) { if (file.type.match(/image.*/)) {
// TODO this needs loolwsd fixing, to support multiline data (blob) var reader = new FileReader();
// var reader = new FileReader(); var socket = this._map._socket;
// reader.onload = (function(aImg) { return function(e) { reader.onload = (function(aImg) {
// this._map._socket.sendMessageWithData('paste mimetype=' + file.type + 'length=' + ..., e.target.result); return function(e) {
// }; })(img); var blob = new Blob(['paste mimetype=' + file.type + '\n', e.target.result]);
// socket.sendMessage(blob);
// reader.readAsArrayBuffer(); };
// })(file);
// handled = true; reader.readAsArrayBuffer(file);
handled = false; handled = true;
} }
} }
} }