Hide the filepicker button in readonly mode
This commit is contained in:
parent
51f1be9f7a
commit
bd422178c4
@ -360,28 +360,29 @@ define([
|
|||||||
CodeMirror.configureTheme();
|
CodeMirror.configureTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileDialogCfg = {
|
if (!readOnly) {
|
||||||
onSelect: function (data) {
|
var fileDialogCfg = {
|
||||||
if (data.type === 'file') {
|
onSelect: function (data) {
|
||||||
var mt = '<media-tag src="' + data.src + '" data-crypto-key="cryptpad:' + data.key + '"></media-tag>';
|
if (data.type === 'file') {
|
||||||
editor.replaceSelection(mt);
|
var mt = '<media-tag src="' + data.src + '" data-crypto-key="cryptpad:' + data.key + '"></media-tag>';
|
||||||
return;
|
editor.replaceSelection(mt);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
common.initFilePicker(fileDialogCfg);
|
|
||||||
APP.$mediaTagButton = $('<button>', {
|
|
||||||
title: Messages.filePickerButton,
|
|
||||||
'class': 'cp-toolbar-rightside-button fa fa-picture-o',
|
|
||||||
style: 'font-size: 17px'
|
|
||||||
}).click(function () {
|
|
||||||
var pickerCfg = {
|
|
||||||
types: ['file'],
|
|
||||||
where: ['root']
|
|
||||||
};
|
};
|
||||||
common.openFilePicker(pickerCfg);
|
common.initFilePicker(fileDialogCfg);
|
||||||
}).appendTo($rightside);
|
APP.$mediaTagButton = $('<button>', {
|
||||||
|
title: Messages.filePickerButton,
|
||||||
|
'class': 'cp-toolbar-rightside-button fa fa-picture-o',
|
||||||
|
style: 'font-size: 17px'
|
||||||
|
}).click(function () {
|
||||||
|
var pickerCfg = {
|
||||||
|
types: ['file'],
|
||||||
|
where: ['root']
|
||||||
|
};
|
||||||
|
common.openFilePicker(pickerCfg);
|
||||||
|
}).appendTo($rightside);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
config.onReady = function (info) {
|
config.onReady = function (info) {
|
||||||
|
|||||||
@ -494,27 +494,29 @@ define([
|
|||||||
|
|
||||||
CodeMirror.configureTheme();
|
CodeMirror.configureTheme();
|
||||||
|
|
||||||
var fileDialogCfg = {
|
if (!readOnly) {
|
||||||
onSelect: function (data) {
|
var fileDialogCfg = {
|
||||||
if (data.type === 'file') {
|
onSelect: function (data) {
|
||||||
var mt = '<media-tag src="' + data.src + '" data-crypto-key="cryptpad:' + data.key + '"></media-tag>';
|
if (data.type === 'file') {
|
||||||
editor.replaceSelection(mt);
|
var mt = '<media-tag src="' + data.src + '" data-crypto-key="cryptpad:' + data.key + '"></media-tag>';
|
||||||
return;
|
editor.replaceSelection(mt);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
common.initFilePicker(fileDialogCfg);
|
|
||||||
APP.$mediaTagButton = $('<button>', {
|
|
||||||
title: Messages.filePickerButton,
|
|
||||||
'class': 'cp-toolbar-rightside-button fa fa-picture-o',
|
|
||||||
style: 'font-size: 17px'
|
|
||||||
}).click(function () {
|
|
||||||
var pickerCfg = {
|
|
||||||
types: ['file'],
|
|
||||||
where: ['root']
|
|
||||||
};
|
};
|
||||||
common.openFilePicker(pickerCfg);
|
common.initFilePicker(fileDialogCfg);
|
||||||
}).appendTo($rightside);
|
APP.$mediaTagButton = $('<button>', {
|
||||||
|
title: Messages.filePickerButton,
|
||||||
|
'class': 'cp-toolbar-rightside-button fa fa-picture-o',
|
||||||
|
style: 'font-size: 17px'
|
||||||
|
}).click(function () {
|
||||||
|
var pickerCfg = {
|
||||||
|
types: ['file'],
|
||||||
|
where: ['root']
|
||||||
|
};
|
||||||
|
common.openFilePicker(pickerCfg);
|
||||||
|
}).appendTo($rightside);
|
||||||
|
}
|
||||||
|
|
||||||
metadataMgr.onChange(function () {
|
metadataMgr.onChange(function () {
|
||||||
var md = metadataMgr.getMetadata();
|
var md = metadataMgr.getMetadata();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user