[Libreoffice-commits] online.git: loleaflet/src
Miklos Vajna
vmiklos at collabora.co.uk
Fri Jan 15 07:07:40 PST 2016
loleaflet/src/layer/tile/TileLayer.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit d91dd9774a98129a8c8212c171c8a89a88c2d3dd
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Jan 15 16:06:52 2016 +0100
loleaflet: prefer HTML over plain text for drop purposes
We iterate over an array provided by the browser, let's always use HTML
and not plain text, even if the array contains plain text first, and
only then HTML.
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index f0bd19d..036fe54 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -949,13 +949,14 @@ L.TileLayer = L.GridLayer.extend({
// handle content
var types = e.dataTransfer.types;
var handled = false;
+ var hasHTML = types.indexOf('text/html') > -1;
for (var t = 0; !handled && t < types.length; t++) {
var type = types[t];
if (type === 'text/html') {
this._map._socket.sendMessage('paste mimetype=text/html\n' + e.dataTransfer.getData(type));
- // handled = true;
+ handled = true;
}
- else if (type === 'text/plain') {
+ else if (type === 'text/plain' && !hasHTML) {
this._map._socket.sendMessage('paste mimetype=text/plain;charset=utf-8\n' + e.dataTransfer.getData(type));
handled = true;
}
More information about the Libreoffice-commits
mailing list