Skip to content
Snippets Groups Projects
Unverified Commit f355e6ce authored by Thomas's avatar Thomas Committed by GitHub
Browse files

Merge pull request #307 from h5p/add-cancel-callback-for-editor-form

Add cancel submit callback when editor form is submitted
parents ac4d9d5e 91546d32
Branches
Tags
No related merge requests found
...@@ -27,6 +27,11 @@ ...@@ -27,6 +27,11 @@
? H5PIntegration.editor.formId ? H5PIntegration.editor.formId
: 'mform1'; : 'mform1';
// Cancel validation and submission of form if clicking cancel button
const cancelSubmitCallback = function ($button) {
return $button.is('[name="cancel"]');
};
H5PEditor.init( H5PEditor.init(
$('#' + mformId), $('#' + mformId),
$('input[name="h5paction"]'), $('input[name="h5paction"]'),
...@@ -36,7 +41,8 @@ ...@@ -36,7 +41,8 @@
$('input[name="h5plibrary"]'), $('input[name="h5plibrary"]'),
$('input[name="h5pparams"]'), $('input[name="h5pparams"]'),
$('input[name="h5pmaxscore"]'), $('input[name="h5pmaxscore"]'),
$('input[name="name"]') $('input[name="name"]'),
cancelSubmitCallback,
); );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment