[Libreoffice-commits] online.git: Branch 'distro/collabora/milestone-7' - loleaflet/src

Jan Holesovsky kendy at collabora.com
Fri Jan 15 10:38:22 PST 2016


 loleaflet/src/layer/tile/TileLayer.js |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 5f81c72558ad4348d9a89d539a6dda38318c7e98
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Jan 15 19:37:29 2016 +0100

    loleaflet: Avoid indexOf, not supported everywhere apparently.

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 036fe54..8be6015 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -948,8 +948,14 @@ L.TileLayer = L.GridLayer.extend({
 
 		// handle content
 		var types = e.dataTransfer.types;
+		var hasHTML = false;
+		for (var t = 0; !hasHTML && t < types.length; t++) {
+			if (types[t] === 'text/html') {
+				hasHTML = true;
+			}
+		}
+
 		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') {


More information about the Libreoffice-commits mailing list