[Libreoffice-commits] online.git: loleaflet/js
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Feb 26 13:25:51 UTC 2019
loleaflet/js/toolbar.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 3106294772329f7560a6a750b0ca5d5e861549af
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Tue Feb 5 22:44:32 2019 -0500
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Feb 26 14:25:34 2019 +0100
leaflet: enable toolbar buttons only when editing
When the uno command state is changed, we shouldn't
enable toolbar buttons if we aren't in edit mode yet.
Change-Id: I0cd99e430439ce278bd21a3cda295dfca22660e8
Reviewed-on: https://gerrit.libreoffice.org/67996
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Tested-by: Szymon Kłos <szymon.klos at collabora.com>
(cherry picked from commit 0234dad4750a8101ad9afbbd33e85574954379a7)
Reviewed-on: https://gerrit.libreoffice.org/67504
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index fd8470af2..fbe7c0905 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -1921,11 +1921,15 @@ function onCommandStateChanged(e) {
var id = unoCmdToToolbarId(commandName);
if (state === 'true') {
- toolbar.enable(id);
+ if (map._permission === 'edit') {
+ toolbar.enable(id);
+ }
toolbar.check(id);
}
else if (state === 'false') {
- toolbar.enable(id);
+ if (map._permission === 'edit') {
+ toolbar.enable(id);
+ }
toolbar.uncheck(id);
}
// Change the toolbar button states if we are in editmode
More information about the Libreoffice-commits
mailing list