loleaflet/src/control/Toolbar.js      |    4 ++--
 loleaflet/src/layer/tile/TileLayer.js |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 058398ee1b05ba64b323749cabd9ffe4883b749f
Author:     Grzegorz Araminowicz <grzegorz.araminow...@collabora.com>
AuthorDate: Mon Oct 21 13:15:31 2019 +0200
Commit:     Jan Holesovsky <ke...@collabora.com>
CommitDate: Thu Oct 31 12:43:31 2019 +0100

    hyperlink dialog: load existing text and link under cursor
    
    Change-Id: Icf5a9e9bce01e311e745845b738e333ee3c5954c
    Reviewed-on: https://gerrit.libreoffice.org/81231
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    Tested-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 2628a5190..822a20154 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -354,8 +354,8 @@ L.Map.include({
                        contentClassName: 'hyperlink-dialog',
                        message: _('Insert hyperlink'),
                        input: [
-                               _('Text') + '<input name="text" type="text"/>',
-                               _('Link') + '<input name="link" type="text"/>'
+                               _('Text') + '<input name="text" type="text" 
value="' + (map.hyperlinkUnderCursor.text || '') + '"/>',
+                               _('Link') + '<input name="link" type="text" 
value="' + (map.hyperlinkUnderCursor.link || '') + '"/>'
                        ].join(''),
                        buttons: [
                                $.extend({}, vex.dialog.buttons.YES, { text: 
_('OK') }),
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 2644a9215..439f058e2 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1048,6 +1048,7 @@ L.TileLayer = L.GridLayer.extend({
                        this._map._setFollowing(false, null);
                }
                this._map.lastActionByUser = false;
+               this._map.hyperlinkUnderCursor = obj.hyperlink;
 
                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.
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to