MDL-31642 added 'max attachments' to filemanager and 'drag and drop' message inside the box

This commit is contained in:
Davo Smith 2012-02-23 19:34:59 +00:00
parent 5bbf3cb72b
commit adce023069
6 changed files with 30 additions and 4 deletions

View file

@ -61,6 +61,7 @@ M.form_filemanager.init = function(Y, options) {
this.currentpath = '/';
this.maxfiles = options.maxfiles;
this.maxbytes = options.maxbytes;
this.emptycallback = null; // Used by drag and drop upload
this.filepicker_options = options.filepicker?options.filepicker:{};
this.filepicker_options.client_id = this.client_id;
@ -264,7 +265,15 @@ M.form_filemanager.init = function(Y, options) {
}, this);
},
empty_filelist: function(container) {
container.set('innerHTML', '<div class="mdl-align">'+M.str.repository.nofilesattached+'</div>'+this.upload_message());
var content = '<div class="mdl-align">'+M.str.repository.nofilesattached;
content += '<span id="dndenabled2-'+this.client_id+'" style="display: none">';
content += ' - '+M.util.get_string('dndenabled_inbox', 'moodle')+'</span>';
content += '</div>';
content += this.upload_message();
container.set('innerHTML', content);
if (this.emptycallback) {
this.emptycallback(this.client_id);
}
},
upload_message: function() {
var div = '<div id="filemanager-uploadmessage'+this.client_id+'" style="display:none" class="dndupload-target">';