mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-53098 lib: Mark form as submitted in confirmation dialog.
If the quiz attempt use popup window with Javascript security it will show to the user misleading message that he is going to lose entered data. To avoid this we should mark form as submitted to turn off browser`s pop-up window when user confirms finishing attempt. Also we need to check if core_formchangechecker is present on a page.
This commit is contained in:
parent
26162efe4a
commit
6e7f41715f
@ -291,10 +291,16 @@ M.util.show_confirm_dialog = function(e, args) {
|
||||
if (target.get('name') && target.get('value')) {
|
||||
targetform.append('<input type="hidden" name="' + target.get('name') +
|
||||
'" value="' + target.get('value') + '">');
|
||||
if (typeof M.core_formchangechecker !== 'undefined') {
|
||||
M.core_formchangechecker.set_form_submitted();
|
||||
}
|
||||
}
|
||||
targetform.submit();
|
||||
|
||||
} else if (target.test('form')) {
|
||||
if (typeof M.core_formchangechecker !== 'undefined') {
|
||||
M.core_formchangechecker.set_form_submitted();
|
||||
}
|
||||
target.submit();
|
||||
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user