loleaflet: enable drop of images
This commit is contained in:
parent
bcf0e2d81f
commit
8845679d2f
1 changed files with 10 additions and 10 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue