From bd422178c46705ef69aaf9e17e84517339a0e806 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 11 Sep 2017 11:59:09 +0200 Subject: [PATCH] Hide the filepicker button in readonly mode --- www/code/inner.js | 41 +++++++++++++++++++++-------------------- www/slide/inner.js | 40 +++++++++++++++++++++------------------- 2 files changed, 42 insertions(+), 39 deletions(-) diff --git a/www/code/inner.js b/www/code/inner.js index dc541e736..200bd4fff 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -360,28 +360,29 @@ define([ CodeMirror.configureTheme(); } - var fileDialogCfg = { - onSelect: function (data) { - if (data.type === 'file') { - var mt = ''; - editor.replaceSelection(mt); - return; + if (!readOnly) { + var fileDialogCfg = { + onSelect: function (data) { + if (data.type === 'file') { + var mt = ''; + editor.replaceSelection(mt); + return; + } } - } - }; - common.initFilePicker(fileDialogCfg); - APP.$mediaTagButton = $('