MDL-71644 Quiz: The issues outstanding from MDL-70947.

Issue 1: While essay question's uploading progress, we need to disable submit
buttons to prevent submit form event.

Issue 2: Enable buttons after pressing cancel button on the popup
confirming overwrite file existed.
This commit is contained in:
Thong Bui 2021-05-18 18:15:25 +07:00
parent 0b69b37f04
commit f81cdd42b2
5 changed files with 38 additions and 10 deletions

View file

@ -756,6 +756,7 @@ M.form_dndupload.init = function(Y, options) {
e.preventDefault();
process_dlg.hide();
if (self.callbackcancel) {
this.triggerUploadCompleted();
self.callbackcancel();
}
}, this);
@ -794,13 +795,26 @@ M.form_dndupload.init = function(Y, options) {
// Destroy the dialog once it has been hidden.
process_dlg.after('visibleChange', function(e) {
if (!process_dlg.get('visible')) {
if (self.callbackcancel) {
this.triggerUploadCompleted();
self.callbackcancel();
}
process_dlg.destroy(true);
}
});
}, this);
process_dlg.show();
},
/**
* Trigger upload completed event.
*/
triggerUploadCompleted: function() {
require(['core_form/events'], function(FormEvent) {
FormEvent.triggerUploadCompleted(this.filemanagerhelper.filemanager.get('id'));
}.bind(this));
},
/**
* Checks if there is already a file with the given name in the current folder
* or in the list of already uploading files
@ -857,9 +871,7 @@ M.form_dndupload.init = function(Y, options) {
*/
uploadfinished: function(lastresult) {
// Trigger form upload complete events.
require(['core_form/events'], function(FormEvent) {
FormEvent.triggerUploadCompleted(this.filemanagerhelper.filemanager.get('id'));
}.bind(this));
this.triggerUploadCompleted();
this.callback(lastresult);
},