MDL-33582 Filepicker: set main file button disabled when not required

This commit is contained in:
Frederic Massart 2012-06-13 16:01:38 +08:00
parent 778121751d
commit 247804bcc2

View File

@ -814,8 +814,8 @@ M.form_filemanager.init = function(Y, options) {
e.preventDefault();
var params = {};
var fileinfo = this.selectui.fileinfo;
if (fileinfo.type == 'folder') {
// this button should not even be shown for folders
if (!this.enablemainfile || fileinfo.type == 'folder') {
// this button should not even be shown for folders or when mainfile is disabled
return;
}
params['filepath'] = fileinfo.filepath;