Bugzilla – Attachment 98014 Details for
Bug 20388
Ability to add search fields from UI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20388: Use live handler for deleting elements
Bug-20388-Use-live-handler-for-deleting-elements.patch (text/plain), 2.81 KB, created by
Alex Arnaud
on 2020-01-28 08:14:51 UTC
(
hide
)
Description:
Bug 20388: Use live handler for deleting elements
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2020-01-28 08:14:51 UTC
Size:
2.81 KB
patch
obsolete
>From b3a9d121aaa1849a0607228d038b1fb49ff78234 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Fri, 22 Mar 2019 16:11:03 +0000 >Subject: [PATCH] Bug 20388: Use live handler for deleting elements >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >Signed-off-by: Michal Denar <black23@gmail.com> >--- > .../en/modules/admin/searchengine/elasticsearch/mappings.tt | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >index 27b8f60..1d98313 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >@@ -28,7 +28,7 @@ > > $(document).ready(function() { > $("#tabs").tabs(); >- $('.delete').click(function() { >+ $(document).on('click', '.delete', function() { > if( $(this).hasClass('mandatory') && $(".mandatory[data-field_name="+$(this).attr('data-field_name')+"]").length < 2 ){ > alert("This field is mandatory and must have at least one mapping"); > return; >@@ -64,12 +64,10 @@ > var marc_field = $(line).find('input[data-id="mapping_marc_field"]').val(); > if ( marc_field.length > 0 ) { > var new_line = clone_line( line ); >+ var search_field_name = $(line).find('select[data-id="mapping_search_field_name"] option:selected').text(); >+ $(new_line).children('td:first').append('<input type="hidden" name="mapping_search_field_name" value="' + search_field_name + '">'); > new_line.appendTo($('table[data-index_name="'+index_name+'"]>tbody')); >- $('.delete').click(function() { >- $(this).parents('tr').remove(); >- }); > >- var search_field_name = $(line).find('select[data-id="mapping_search_field_name"] option:selected').text(); > var search_field_line = $('input[name="search_field_name"][value="' + search_field_name + '"]').closest("tr"); > $(search_field_line).find('a.btn-default').addClass('disabled'); > >@@ -93,9 +91,6 @@ > if ( name.length > 0 && label.length > 0 ) { > var new_line = clone_line( line ); > new_line.appendTo($('table[data-index_name=search_fields]>tbody')); >- $('.delete').click(function() { >- $(this).parents('tr').remove(); >- }); > clean_line(line); > > $(table).tableDnD( { >-- >2.7.4
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 20388
:
73158
|
73165
|
73167
|
73476
|
73626
|
73627
|
73629
|
73681
|
73682
|
73918
|
73919
|
73940
|
73943
|
73944
|
73945
|
73946
|
74261
|
74718
|
74719
|
78658
|
78659
|
80709
|
86912
|
87196
|
87197
|
87198
|
87199
|
87201
|
87202
|
87203
|
87204
|
88075
|
88079
|
88080
|
88081
|
88082
|
88083
|
89117
|
89118
|
89121
|
89733
|
89894
|
90517
|
90518
|
90519
|
90520
|
90521
|
90522
|
90523
|
90524
|
98011
|
98012
|
98013
|
98014
|
98015
|
98016
|
98017
|
98018
|
99960
|
99961
|
99962
|
99963
|
99964
|
99965
|
99966
|
99967
|
119296
|
119317
|
119318
|
120104
|
163449
|
163450
|
163451
|
163452
|
163460
|
163461
|
163462
|
163463
|
164529
|
164530
|
164531
|
164532
|
164533
|
164534
|
164535
|
164789
|
164790
|
164791
|
164792
|
164793