Bugzilla – Attachment 105271 Details for
Bug 25587
JavaScript issue - "clear" button doesn't reset some dropdowns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25587: fix for "clear" button to reset all selects
Bug-25587-fix-for-clear-button-to-reset-all-select.patch (text/plain), 1.63 KB, created by
Peter Vashchuk
on 2020-05-22 15:18:56 UTC
(
hide
)
Description:
Bug 25587: fix for "clear" button to reset all selects
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2020-05-22 15:18:56 UTC
Size:
1.63 KB
patch
obsolete
>From 5c4db6bb11146c5fb213c55c88663aacd5a61127 Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Fri, 22 May 2020 18:11:28 +0300 >Subject: [PATCH] Bug 25587: fix for "clear" button to reset all selects > >Button "clear" on cgi-bin/koha/admin/smart-rules.pl did not reset fields with a dropdown selector except the first one. > >This happens because jQuery selector .find("select option:first") >in koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >selects only single first element in the whole group, as from jquery doc: >> The :first pseudo-class is equivalent to :eq( 0 ). It could also be written as :lt( 1 ). While this matches only a single element, :first-child can match more than one: One for each parent. (https://api.jquery.com/first-selector/) > >And it works if replaced by: .find("select option:first-child") >--- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index 5ae3bb94e1..61f36a1788 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -941,7 +941,7 @@ > } > }); > $(edit_row).find("select").prop('disabled', false); >- $(edit_row).find("select option:first").attr("selected", "selected"); >+ $(edit_row).find("select option:first-child").attr("selected", "selected"); > $(edit_row).find("td:last input[name='clear']").remove(); > } > >-- >2.17.1
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 25587
:
105271
|
105272
|
105285
|
105566