[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - loleaflet/js
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Feb 25 14:29:13 UTC 2019
loleaflet/js/toolbar.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 0234dad4750a8101ad9afbbd33e85574954379a7
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: Mon Feb 25 15:28:55 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>
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 8197c5d1e..f85773d12 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -1919,11 +1919,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