Bugzilla – Attachment 169660 Details for
Bug 35044
Additional fields: Allow for repeatable fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35044: (QA follow-up): Avoid polluting global scope with functions
Bug-35044-QA-follow-up-Avoid-polluting-global-scop.patch (text/plain), 2.70 KB, created by
Julian Maurice
on 2024-07-26 07:50:06 UTC
(
hide
)
Description:
Bug 35044: (QA follow-up): Avoid polluting global scope with functions
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2024-07-26 07:50:06 UTC
Size:
2.70 KB
patch
obsolete
>From 496d824936452ea6f247f8b4fee19995078f0833 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 25 Jul 2024 16:52:10 +0000 >Subject: [PATCH] Bug 35044: (QA follow-up): Avoid polluting global scope with > functions > >using immediately invoked function expression > >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> > >https://bugs.koha-community.org/show_bug.cgi?id=25044 >--- > .../prog/js/additional-fields-entry.js | 58 +++++++++++-------- > 1 file changed, 35 insertions(+), 23 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/additional-fields-entry.js b/koha-tmpl/intranet-tmpl/prog/js/additional-fields-entry.js >index 590533b7d5..a50ba9e33a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/additional-fields-entry.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/additional-fields-entry.js >@@ -1,28 +1,40 @@ >-$(document).ready(function() { >- $("#additional_fields_form_section").on("click", ".clone_attribute", function(e){ >- e.preventDefault(); >- clone_entry( this ); >- }); >+(function () { >+ $(document).ready(function () { >+ $("#additional_fields_form_section").on( >+ "click", >+ ".clone_attribute", >+ function (e) { >+ e.preventDefault(); >+ clone_entry(this); >+ } >+ ); > >- $("#additional_fields_form_section").on("click", ".clear_attribute", function(e){ >- e.preventDefault(); >- clear_entry( this ); >- }); >+ $("#additional_fields_form_section").on( >+ "click", >+ ".clear_attribute", >+ function (e) { >+ e.preventDefault(); >+ clear_entry(this); >+ } >+ ); > >- $('#additional_fields_form_section').parents('form ').submit(function() { >- $('.marcfieldget').prop("disabled", false); >- return true; >+ $("#additional_fields_form_section") >+ .parents("form ") >+ .submit(function () { >+ $(".marcfieldget").prop("disabled", false); >+ return true; >+ }); > }); >-}); > >-function clone_entry(node) { >- var original = $(node).parent(); >- var clone = $(node).parent().clone(); >- $(original).after(clone); >- return false; >-} >+ function clone_entry(node) { >+ var original = $(node).parent(); >+ var clone = $(node).parent().clone(); >+ $(original).after(clone); >+ return false; >+ } > >-function clear_entry(node) { >- var original = $(node).parent(); >- $("input", original).val(''); >-} >\ No newline at end of file >+ function clear_entry(node) { >+ var original = $(node).parent(); >+ $("input", original).val(""); >+ } >+})(); >\ No newline at end of file >-- >2.39.2
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 35044
:
157324
|
157325
|
157326
|
157327
|
157328
|
157329
|
157330
|
157331
|
157332
|
157333
|
157334
|
158113
|
158498
|
158499
|
158500
|
158501
|
158502
|
158503
|
158504
|
158505
|
158506
|
158507
|
158508
|
158857
|
158858
|
158859
|
158860
|
158861
|
158862
|
158863
|
158864
|
158865
|
158866
|
158867
|
158868
|
159268
|
160177
|
160178
|
160179
|
160180
|
160181
|
160182
|
160183
|
160184
|
160185
|
160186
|
160187
|
160188
|
160189
|
164162
|
164163
|
164164
|
164165
|
164166
|
164167
|
164168
|
164169
|
164170
|
164171
|
164172
|
164173
|
164174
|
167690
|
168537
|
168538
|
168539
|
168540
|
168541
|
168542
|
168543
|
168544
|
168545
|
168546
|
168547
|
168548
|
169545
|
169546
|
169547
|
169603
|
169604
|
169605
|
169606
|
169607
|
169643
|
169644
|
169645
|
169646
|
169647
|
169648
|
169649
|
169650
|
169651
|
169652
|
169653
|
169654
|
169655
|
169656
|
169657
|
169658
|
169659
|
169660
|
169661
|
169662
|
169663
|
169664
|
169665
|
169666
|
169667
|
169668
|
169669
|
169670
|
169671
|
169672
|
169673
|
169674
|
169675
|
169676
|
169677
|
169678
|
169679
|
169680
|
169681
|
169682
|
169683
|
169684
|
169697
|
170501