WYSIWYG: Allow to editor file picker select files according the filetype #5273

pull/5293/head
Angel Fernando Quiroz Campos 2 years ago
parent 3a3cf9e0fe
commit e8fd9fcdd4
  1. 5
      assets/vue/components/basecomponents/BaseTinyEditor.vue

@ -176,6 +176,11 @@ async function filePickerCallback(callback, value, meta) {
if (!props.useFileManager) {
const input = document.createElement("input")
input.setAttribute("type", "file")
if ("image" === meta.filetype) {
input.accept = "image/*"
} else if ("media" === meta.filetype) {
input.accept = "audio/*, video/*"
}
input.style.display = "none"
input.onchange = inputFileHandler(callback, input)
document.body.appendChild(input)

Loading…
Cancel
Save