mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 16:04:25 +02:00
MDL-57097 mod_assign: add event listener to avoid form submit
This commit is contained in:
parent
0fbe41f4cd
commit
b6f549d139
2
mod/assign/amd/build/grading_panel.min.js
vendored
2
mod/assign/amd/build/grading_panel.min.js
vendored
File diff suppressed because one or more lines are too long
@ -347,6 +347,11 @@ define(['jquery', 'core/yui', 'core/notification', 'core/templates', 'core/fragm
|
||||
*/
|
||||
GradingPanel.prototype.registerEventListeners = function() {
|
||||
var docElement = $(document);
|
||||
var region = $(this._region);
|
||||
// Add an event listener to prevent form submission when pressing enter key.
|
||||
region.on('submit', 'form', function(e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
docElement.on('user-changed', this._refreshGradingPanel.bind(this));
|
||||
docElement.on('save-changes', this._submitForm.bind(this));
|
||||
|
Loading…
x
Reference in New Issue
Block a user