display a disabled upload button to logged out users in the filepicker modal

pull/1/head
ansuz 5 years ago
parent b419ead7fe
commit 1ef79d44b4

@ -177,7 +177,7 @@ define([
}); });
// If file, display the upload button // If file, display the upload button
if (types.indexOf('file') !== -1 && common.isLoggedIn()) { if (types.indexOf('file') !== -1) {
var f = (filters && filters.filter) || {}; var f = (filters && filters.filter) || {};
delete data.accept; delete data.accept;
if (Array.isArray(f.fileType)) { if (Array.isArray(f.fileType)) {
@ -188,7 +188,13 @@ define([
return val; return val;
}); });
} }
$filter.append(common.createButton('upload', false, data)); }
var $uploadButton = common.createButton('upload', false, data);
$filter.append($uploadButton);
if (!common.isLoggedIn()) {
$uploadButton.prop('disabled', true)
.prop('title', Messages.upload_mustLogin);
} }
var $container = $(h('span.cp-filepicker-content', [ var $container = $(h('span.cp-filepicker-content', [

Loading…
Cancel
Save