loleaflet/src/layer/tile/TileLayer.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
New commits: commit d2c1d60c34adab0ea50443cd5ef54c5f4571d640 Author: mert <mert.tu...@collabora.com> AuthorDate: Mon Mar 2 16:48:50 2020 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Mon Mar 2 21:28:34 2020 +0100 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 <jenkinscollaboraoff...@gmail.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> (cherry picked from commit 41d065af2a8e58d76f53c9b57ff55093e0210531) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89804 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}); }, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits