summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2020-01-13 09:24:29 +0300
committerHenry Castro <hcastro@collabora.com>2020-01-13 23:15:52 +0100
commit7b94981b7d73626af6cdcab7ce694781b07b5e4a (patch)
tree0d65b5b654fba1744da4814cb15e36269c9f6cfe
parent1cf5bde981941f2ac2920819e93fb55a7ca3bac1 (diff)
Show hyperlink pop-up on cell selection
Change-Id: I59f3301bd94c4d898ec2ff82fd91d3c611122d3a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86651 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Henry Castro <hcastro@collabora.com>
-rw-r--r--loleaflet/src/layer/tile/TileLayer.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 8d31a7647..0d64ded2d 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2843,6 +2843,29 @@ L.TileLayer = L.GridLayer.extend({
this._map.removeLayer(this._cellCursorMarker);
}
this._removeDropDownMarker();
+
+ //hyperlink pop-up from here
+ if (this._lastFormula && this._cellCursorMarker && this._lastFormula.substring(1, 10) == 'HYPERLINK')
+ {
+ var formula = this._lastFormula;
+ var targetURL = formula.substring(11, formula.length - 1).split(',')[0];
+ targetURL = targetURL.split('"').join('');
+ targetURL = this._map.makeURLFromStr(targetURL);
+
+ this._map.closePopup(this._map.hyperlinkPopup);
+ this._map.hyperlinkPopup = null;
+ if (targetURL) {
+ this._map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false})
+ .setContent('<a href="' + targetURL + '" target="_blank">' + targetURL + '</a>')
+ .setLatLng(this._cellCursorMarker._bounds._northEast)
+ .openOn(this._map);
+ }
+
+ }
+ else if (this._map.hyperlinkPopup)
+ {
+ this._map.closePopup(this._map.hyperlinkPopup);
+ }
},
_onValidityListButtonMsg: function(textMsg) {