summaryrefslogtreecommitdiff
path: root/loleaflet
diff options
context:
space:
mode:
authorThais Vieira <thais.vieira@collabora.com>2020-09-14 10:37:35 -0300
committerPedro Silva <pedro.silva@collabora.com>2020-09-16 12:38:35 +0200
commit54cad07c4ee0f9283c6cdf8e71c4ad46798add73 (patch)
tree544fb2398d9a4530c9c5471ee514a3fbfc9cc8e3 /loleaflet
parent328ed481179cb8d79c5a1eacc1a24e69b492739a (diff)
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@gmail.com> Reviewed-by: Pedro Silva <pedro.silva@collabora.com>
Diffstat (limited to 'loleaflet')
-rw-r--r--loleaflet/html/loleaflet.html.m44
-rw-r--r--loleaflet/src/control/Control.DocumentNameInput.js3
2 files changed, 4 insertions, 3 deletions
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));