From 78f738143b5ba439171d09ce7928511bc3c32848 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 20 Dec 2017 11:41:47 +0100 Subject: [PATCH] Hide the markdown toolbar in read-only mode --- www/common/common-ui-elements.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index c8bb6f1c7..c426a0272 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -372,6 +372,15 @@ define([ return $toolbar; }; UIElements.createMarkdownToolbar = function (common, editor) { + var readOnly = common.getMetadataMgr().getPrivateData().readOnly; + if (readOnly) { + return { + toolbar: $(), + button: $(), + setState: function () {} + }; + } + var $toolbar = createMdToolbar(common, editor); var cfg = { title: Messages.mdToolbar_button,