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

Thais Vieira (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 16 10:38:54 UTC 2020


 loleaflet/html/loleaflet.html.m4                   |    4 ++--
 loleaflet/src/control/Control.DocumentNameInput.js |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 54cad07c4ee0f9283c6cdf8e71c4ad46798add73
Author:     Thais Vieira <thais.vieira at collabora.com>
AuthorDate: Mon Sep 14 10:37:35 2020 -0300
Commit:     Pedro Silva <pedro.silva at collabora.com>
CommitDate: Wed Sep 16 12:38:35 2020 +0200

    Loleaflet: fix pencil icon
    
    - to be displayed after the toolbar appears
    - only when it's possible to edit the name of the document
    - only when not in presence of android app and hidden (display: none) by default so it does show up before input field
    
    Change-Id: I5c78593b1229da1682832a46e6fc8f1b09b31e12
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102675
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Pedro Silva <pedro.silva at collabora.com>

diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4
index 31820d1bd..7abe51f18 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -160,7 +160,7 @@ m4_ifelse(MOBILEAPP,[true],
        <div id="document-titlebar">
          <div class="document-title">
            <input id="document-name-input" type="text" disabled="true" style="display: none"/>
-           <div id="document-title-pencil"></div>
+           <div id="document-title-pencil" style="display: none"></div>
          </div>
        </div>
      </nav>
@@ -280,7 +280,7 @@ m4_ifelse(MOBILEAPP,[true],
       window.tileSize = 256;])
 m4_syscmd([cat ]GLOBAL_JS)m4_dnl
 
-// Dynamically load the appropriate *-mobile.css, *-tablet.css or *-desktop.css 
+// Dynamically load the appropriate *-mobile.css, *-tablet.css or *-desktop.css
 var link = document.createElement('link');
 link.setAttribute("rel", "stylesheet");
 link.setAttribute("type", "text/css");
diff --git a/loleaflet/src/control/Control.DocumentNameInput.js b/loleaflet/src/control/Control.DocumentNameInput.js
index 4683dd35f..1b5697f27 100644
--- a/loleaflet/src/control/Control.DocumentNameInput.js
+++ b/loleaflet/src/control/Control.DocumentNameInput.js
@@ -12,7 +12,6 @@ L.Control.DocumentNameInput = L.Control.extend({
 		map.on('doclayerinit', this.onDocLayerInit, this);
 		map.on('wopiprops', this.onWopiProps, this);
 		map.on('resize', this.onResize, this);
-		$('#document-title-pencil').addClass('editable');
 	},
 
 	documentNameConfirm: function() {
@@ -76,6 +75,7 @@ L.Control.DocumentNameInput = L.Control.extend({
 			$('#document-name-input').hide();
 		} else {
 			$('#document-name-input').show();
+			$('#document-title-pencil').show();
 		}
 
 		if (window.ThisIsAMobileApp) {
@@ -101,6 +101,7 @@ L.Control.DocumentNameInput = L.Control.extend({
 		if (e.UserCanNotWriteRelative === false) {
 			// Save As allowed
 			$('#document-name-input').prop('disabled', false);
+			$('#document-title-pencil').addClass('editable');
 			$('#document-name-input').addClass('editable');
 			$('#document-name-input').off('keypress', this.onDocumentNameKeyPress).on('keypress', this.onDocumentNameKeyPress.bind(this));
 			$('#document-name-input').off('focus', this.onDocumentNameFocus).on('focus', this.onDocumentNameFocus.bind(this));


More information about the Libreoffice-commits mailing list