1
0
mirror of https://github.com/moodle/moodle.git synced 2025-03-15 05:00:06 +01:00

MDL-64554 form: reset form change checker before triggering submit event

This commit is contained in:
Marina Glancy 2021-02-18 12:04:58 +01:00 committed by Eloy Lafuente (stronk7)
parent 28dadc2fb9
commit 1e03a240b5
3 changed files with 10 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -381,11 +381,14 @@ export default class ModalForm {
} else {
// Form was submitted properly. Hide the modal and execute callback.
const data = JSON.parse(response.data);
return this.notifyResetFormChanges()
.then(() => {
const event = this.trigger(this.events.FORM_SUBMITTED, data);
if (!event.defaultPrevented) {
this.modal.hide();
}
return null;
});
}
return null;
})