Bug 39567: Run JS change in separate file ESM as per JS1
As per JS1 in the coding guidelines, I've moved the inline JS from the template into a separate file. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
3478e09d41
commit
eeb86254da
|
|
@ -26,13 +26,7 @@
|
|||
[% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
|
||||
<!-- koha core js -->
|
||||
[% Asset.js("js/staff-global.js") | $raw %]
|
||||
<script type="module">
|
||||
import { submit_form } from "/intranet-tmpl/prog/js/form-submit.js";
|
||||
$("body").on("click", ".submit-form-link", function (e) {
|
||||
e.preventDefault();
|
||||
submit_form(this);
|
||||
});
|
||||
</script>
|
||||
[% Asset.js("js/form-submit.js",{'type' => 'module'}) | $raw %]
|
||||
[% INCLUDE 'js-date-format.inc' %]
|
||||
[% INCLUDE 'js-patron-get-age.inc' %]
|
||||
[% INCLUDE 'js-patron-format-address.inc' %]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export function submit_form(form) {
|
||||
function submit_form(form) {
|
||||
let form_data = $(form).data();
|
||||
|
||||
let confirm_msg = form_data.confirmationMsg;
|
||||
|
|
@ -33,3 +33,8 @@ export function submit_form(form) {
|
|||
$("body").append(the_form);
|
||||
the_form.submit();
|
||||
}
|
||||
|
||||
$("body").on("click", ".submit-form-link", function (e) {
|
||||
e.preventDefault();
|
||||
submit_form(this);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -102,13 +102,7 @@
|
|||
let logged_in_user_id = "[% logged_in_user.borrowernumber | html %]";
|
||||
</script>
|
||||
[% Asset.js("js/global.js") | $raw %]
|
||||
<script type="module">
|
||||
import { submit_form } from "/opac-tmpl/bootstrap/js/form-submit.js";
|
||||
$("body").on("click", ".submit-form-link", function (e) {
|
||||
e.preventDefault();
|
||||
submit_form(this);
|
||||
});
|
||||
</script>
|
||||
[% Asset.js("js/form-submit.js",{'type' => 'module'}) | $raw %]
|
||||
[% IF ( OPACAmazonCoverImages || SyndeticsCoverImages ) %]
|
||||
[% Asset.js("js/amazonimages.js") | $raw %]
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export function submit_form(form) {
|
||||
function submit_form(form) {
|
||||
let form_data = $(form).data();
|
||||
|
||||
let confirm_msg = form_data.confirmationMsg;
|
||||
|
|
@ -33,3 +33,8 @@ export function submit_form(form) {
|
|||
$("body").append(the_form);
|
||||
the_form.submit();
|
||||
}
|
||||
|
||||
$("body").on("click", ".submit-form-link", function (e) {
|
||||
e.preventDefault();
|
||||
submit_form(this);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue