mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
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:
parent
0b69b37f04
commit
f81cdd42b2
5 changed files with 38 additions and 10 deletions
|
@ -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);
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue