Bugzilla – Attachment 165970 Details for
Bug 36246
Have a centralized method for submitting a form via a link
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36246: (QA follow-up) New JS should start tidy
Bug-36246-QA-follow-up-New-JS-should-start-tidy.patch (text/plain), 2.55 KB, created by
Martin Renvoize (ashimema)
on 2024-05-01 13:23:01 UTC
(
hide
)
Description:
Bug 36246: (QA follow-up) New JS should start tidy
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-05-01 13:23:01 UTC
Size:
2.55 KB
patch
obsolete
>From 4989b1f80c61589ab32304da41fc8992a5a4496f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 1 May 2024 14:19:02 +0100 >Subject: [PATCH] Bug 36246: (QA follow-up) New JS should start tidy > >Add the `/* keep tidy */` flag so the new file stays tidy > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../intranet-tmpl/prog/js/form-submit.js | 37 ++++++++++--------- > 1 file changed, 20 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/form-submit.js b/koha-tmpl/intranet-tmpl/prog/js/form-submit.js >index dc19d1bb77a..d7b8222cbe6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/form-submit.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/form-submit.js >@@ -1,33 +1,36 @@ >-$(document).ready(function(){ >- >- $('.submit-form-link').click(function(e){ >+/* keep tidy */ >+$(document).ready(function () { >+ $(".submit-form-link").click(function (e) { > e.preventDefault(); > let form_data = $(this).data(); > > let confirm_msg = form_data.confirmationMsg; >- if( confirm_msg ){ >- let confirmation = confirm( confirm_msg ); >- if( !confirmation ){ return false; } >+ if (confirm_msg) { >+ let confirmation = confirm(confirm_msg); >+ if (!confirmation) { >+ return false; >+ } > delete form_data.confirmationMsg; > } > >- let the_form = $('<form/>'); >- if( form_data.method === 'post' ){ >- form_data.csrf_token = $('meta[name="csrf-token"]').attr('content'); >+ let the_form = $("<form/>"); >+ if (form_data.method === "post") { >+ form_data.csrf_token = $('meta[name="csrf-token"]').attr("content"); > } >- the_form.attr('method', form_data.method); >- the_form.attr('action', form_data.action); >+ the_form.attr("method", form_data.method); >+ the_form.attr("action", form_data.action); > delete form_data.method; > delete form_data.action; >- $.each( form_data, function( key, value){ >- the_form.append( $('<input/>',{ >- type: "hidden", >- name: key, >- value: value, >+ $.each(form_data, function (key, value) { >+ the_form.append( >+ $("<input/>", { >+ type: "hidden", >+ name: key, >+ value: value, > }) > ); > }); >- $('body').append( the_form ); >+ $("body").append(the_form); > the_form.submit(); > }); > }); >-- >2.44.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36246
:
162835
|
163098
|
163517
|
164830
|
164831
|
164832
|
165967
|
165968
|
165969
| 165970 |
165971