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

New commits:
commit 221e3a59b73db56441f6a6fc8cf89eb322c1f6cf
Author:     Thais Vieira <thais.vie...@collabora.com>
AuthorDate: Mon Sep 14 10:37:35 2020 -0300
Commit:     Pedro Silva <pedro.si...@collabora.com>
CommitDate: Wed Sep 16 13:00:42 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/+/102760
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Pedro Silva <pedro.si...@collabora.com>

diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4
index 96d02c53e..826ec6aea 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -161,7 +161,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>
diff --git a/loleaflet/src/control/Control.DocumentNameInput.js 
b/loleaflet/src/control/Control.DocumentNameInput.js
index 0a79ff736..8dc67928c 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));
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to