summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormert <mert.tumer@collabora.com>2020-03-02 16:48:50 +0300
committerAndras Timar <andras.timar@collabora.com>2020-03-02 21:28:34 +0100
commitd2c1d60c34adab0ea50443cd5ef54c5f4571d640 (patch)
treeb9e82670e9a25bebaa34f23778bd7592f9bb02fb
parent461e3ef440a64441e74b6be618c24c83252de351 (diff)
Fix hyperlinkclicked message is not properly parsed
$.inArray does not work because the parsed msg is not an array Change-Id: I68a8312da17b0832b09a88afeaf05ad75a2c6e2d Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89833 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit 41d065af2a8e58d76f53c9b57ff55093e0210531) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89804
-rw-r--r--loleaflet/src/layer/tile/TileLayer.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index e9b5ed12b..9de7db98d 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1095,13 +1095,15 @@ L.TileLayer = L.GridLayer.extend({
_onHyperlinkClickedMsg: function (textMsg) {
var link = null;
var coords = null;
+ var hyperlinkMsgStart = 'hyperlinkclicked: ';
+ var coordinatesMsgStart = ' coordinates: ';
- if ($.inArray('coordinates', textMsg) !== -1) {
- var coordpos = textMsg.indexOf(' coordinates');
- link = textMsg.substring(18, coordpos);
- coords = textMsg.substring(coordpos+12);
+ if (textMsg.indexOf(coordinatesMsgStart) !== -1) {
+ var coordpos = textMsg.indexOf(coordinatesMsgStart);
+ link = textMsg.substring(hyperlinkMsgStart.length, coordpos);
+ coords = textMsg.substring(coordpos+coordinatesMsgStart.length);
} else
- link = textMsg.substring(18);
+ link = textMsg.substring(hyperlinkMsgStart.length);
this._map.fire('hyperlinkclicked', {url: link, coordinates: coords});
},