mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merge branch 'MDL-31643_dndupload_reject_all_files' of git://github.com/davosmith/moodle
This commit is contained in:
commit
9b0e5e9d0d
1 changed files with 6 additions and 5 deletions
|
@ -294,21 +294,22 @@ M.form_dndupload.init = function(Y, options) {
|
||||||
this.pageentercount = 0;
|
this.pageentercount = 0;
|
||||||
this.hide_upload_ready();
|
this.hide_upload_ready();
|
||||||
this.hide_drop_target();
|
this.hide_drop_target();
|
||||||
this.show_progress_spinner();
|
|
||||||
|
|
||||||
var files = e._event.dataTransfer.files;
|
var files = e._event.dataTransfer.files;
|
||||||
if (this.filemanager) {
|
if (this.filemanager) {
|
||||||
var currentfilecount = this.filemanager.filecount;
|
var currentfilecount = this.filemanager.filecount;
|
||||||
for (var i=0, f; f=files[i]; i++) {
|
if (((currentfilecount + files.length) > this.maxfiles) && (this.maxfiles != -1)) {
|
||||||
if (currentfilecount >= this.maxfiles && this.maxfiles != -1) {
|
|
||||||
alert(M.util.get_string('maxfilesreached', 'moodle', this.maxfiles));
|
alert(M.util.get_string('maxfilesreached', 'moodle', this.maxfiles));
|
||||||
break;
|
return false;
|
||||||
}
|
}
|
||||||
|
this.show_progress_spinner();
|
||||||
|
for (var i=0, f; f=files[i]; i++) {
|
||||||
if (this.upload_file(f)) {
|
if (this.upload_file(f)) {
|
||||||
currentfilecount++;
|
currentfilecount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
this.show_progress_spinner();
|
||||||
if (files.length >= 1) {
|
if (files.length >= 1) {
|
||||||
this.upload_file(files[0]);
|
this.upload_file(files[0]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue