[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 10 10:37:54 UTC 2020


 loleaflet/src/control/Control.DocumentNameInput.js |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit d778ba3493ef02e2af86e91f916b73c0bf8ef311
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Tue Jun 9 15:50:59 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Jun 10 12:37:36 2020 +0200

    Pre-select base filename on rename click / focus.
    
    Change-Id: I62fb629dc6021ab8cd60b46f73e8d9e39c2da4e0
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95953
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 6284f2d3b67ecae99149e8675688b4d80b170786)
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95972
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/control/Control.DocumentNameInput.js b/loleaflet/src/control/Control.DocumentNameInput.js
index e11d6bf95..ab22cd1a3 100644
--- a/loleaflet/src/control/Control.DocumentNameInput.js
+++ b/loleaflet/src/control/Control.DocumentNameInput.js
@@ -56,6 +56,12 @@ L.Control.DocumentNameInput = L.Control.extend({
 	onDocumentNameFocus: function() {
 		// hide the caret in the main document
 		this.map._onLostFocus();
+		var name = this.map['wopi'].BaseFileName;
+		var extn = name.lastIndexOf('.');
+		if (extn < 0)
+			extn = name.length;
+		$('#document-name-input').val(name);
+		$('#document-name-input')[0].setSelectionRange(0, extn);
 	},
 
 	onDocLayerInit: function() {


More information about the Libreoffice-commits mailing list