[Libreoffice-commits] online.git: loleaflet/src

Grzegorz Araminowicz (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 5 16:44:24 UTC 2019


 loleaflet/src/layer/tile/TileLayer.js |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 76dadbeea045e91aa3ba896b28fab12689083586
Author:     Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>
AuthorDate: Mon Oct 28 13:49:28 2019 +0100
Commit:     Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>
CommitDate: Tue Nov 5 17:44:06 2019 +0100

    display popup with address when cursor is over hyperlink
    
    Change-Id: Icc480c8e9936af4abe500d78704a9b49c9426230
    Reviewed-on: https://gerrit.libreoffice.org/81603
    Reviewed-by: Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>
    Tested-by: Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 439f058e2..912a7e3d8 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1048,7 +1048,16 @@ L.TileLayer = L.GridLayer.extend({
 			this._map._setFollowing(false, null);
 		}
 		this._map.lastActionByUser = false;
+
 		this._map.hyperlinkUnderCursor = obj.hyperlink;
+		this._map.closePopup(this._map.hyperlinkPopup);
+		this._map.hyperlinkPopup = null;
+		if (obj.hyperlink.link) {
+			this._map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false})
+				.setContent('<a href="' + obj.hyperlink.link + '" target="_blank">' + obj.hyperlink.link + '</a>')
+				.setLatLng(cursorPos)
+				.openOn(this._map);
+		}
 
 		if (!this._map._isFocused && (modifierViewId === this._viewId) && (this._map.getWinId === 0) && (this._map._permission === 'edit')) {
 			// Regain cursor if we had been out of focus and now have input.


More information about the Libreoffice-commits mailing list