mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-57097 mod_assign: add event listener to avoid form submit
This commit is contained in:
parent
0fbe41f4cd
commit
b6f549d139
2 changed files with 6 additions and 1 deletions
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() {
|
GradingPanel.prototype.registerEventListeners = function() {
|
||||||
var docElement = $(document);
|
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('user-changed', this._refreshGradingPanel.bind(this));
|
||||||
docElement.on('save-changes', this._submitForm.bind(this));
|
docElement.on('save-changes', this._submitForm.bind(this));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue