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

gokaysatir (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 3 14:33:59 UTC 2020


 loleaflet/src/control/Toolbar.js |   18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

New commits:
commit dbdc500c0700c2a17ed18ec6ae31ca70d6f16ce2
Author:     gokaysatir <gokaysatir at collabora.com>
AuthorDate: Wed Jul 29 18:00:44 2020 +0300
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Mon Aug 3 16:33:41 2020 +0200

    loleaflet: Hyperlink textbox focus & content.
    
    Change-Id: I08db18c98fc43861cc8783700b28cbeb6f9b5a74
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99710
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index f85747188..b22be1c83 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -591,7 +591,9 @@ L.Map.include({
 			text = this.hyperlinkUnderCursor.text;
 			link = this.hyperlinkUnderCursor.link;
 		} else if (this._clip && this._clip._selectionType == 'text') {
-			text = this.extractContent(this._clip._selectionContent);
+			if (map['stateChangeHandler'].getItemValue('.uno:Copy') === 'enabled') {
+				text = this.extractContent(this._clip._selectionContent);
+			}
 		} else if (this._docLayer._selectedTextContent) {
 			text = this.extractContent(this._docLayer._selectedTextContent);
 		}
@@ -600,8 +602,8 @@ L.Map.include({
 			contentClassName: 'hyperlink-dialog',
 			message: _('Insert hyperlink'),
 			input: [
-				_('Text') + '<input name="text" type="text" value="' + text + '"/>',
-				_('Link') + '<input name="link" type="text" value="' + link + '"/>'
+				_('Text') + '<input name="text" id="hyperlink-text-box" type="text" value="' + text + '"/>',
+				_('Link') + '<input name="link" id="hyperlink-link-box" type="text" value="' + link + '"/>'
 			].join(''),
 			buttons: [
 				$.extend({}, vex.dialog.buttons.YES, { text: _('OK') }),
@@ -625,6 +627,16 @@ L.Map.include({
 				else {
 					map.focus();
 				}
+			},
+			afterOpen: function() {
+				setTimeout(function() {
+					if (document.getElementById('hyperlink-text-box').value.trim() !== '') {
+						document.getElementById('hyperlink-link-box').focus();
+					}
+					else {
+						document.getElementById('hyperlink-text-box').focus();
+					}
+				}, 0);
 			}
 		});
 	}


More information about the Libreoffice-commits mailing list