Hide the markdown toolbar in read-only mode

pull/1/head
yflory 2017-12-20 11:41:47 +01:00
parent 3177fd7857
commit 78f738143b
1 changed files with 9 additions and 0 deletions

View File

@ -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,