Bugzilla – Attachment 166424 Details for
Bug 36774
Flatpickr clear() adds unintentional clear button
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36774: Remove wrapper if already exists
Bug-36774-Remove-wrapper-if-already-exists.patch (text/plain), 1.96 KB, created by
Pedro Amorim
on 2024-05-08 15:46:11 UTC
(
hide
)
Description:
Bug 36774: Remove wrapper if already exists
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-05-08 15:46:11 UTC
Size:
1.96 KB
patch
obsolete
>From 05110d7a93ca68fe684c186bc090252d202d1e00 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 3 May 2024 14:07:25 +0000 >Subject: [PATCH] Bug 36774: Remove wrapper if already exists > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index 62a7059b09..3eae704b50 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -60,17 +60,21 @@ > "firstDayOfWeek": calendarFirstDayOfWeek > }, > onReady: function( selectedDates, dateStr, instance ){ >+ >+ /* When onReady is triggered, remove any existing "clear date" link */ >+ $(instance.input).parent().find('.flatpickr_wrapper_' + instance.input.id).remove(); >+ > /* When flatpickr instance is created, automatically append a "clear date" link */ > $(instance.input).find('~input.flatpickr:first') > /* Add a wrapper element so that we can prevent the clear button from wrapping */ >- .wrap("<span class='flatpickr_wrapper'></span>") >+ .wrap("<span class='flatpickr_wrapper flatpickr_wrapper_"+instance.input.id+"'></span>") > .attr("autocomplete", "off") > .after( $("<a/>") > .attr("href","#") > .addClass("clear_date") > .on("click", function(e){ > e.preventDefault(); >- instance.clear(); >+ instance.input.flatpickr().clear(); > }) > .addClass("fa fa-fw fa-times") > .attr("aria-hidden", true) >-- >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 36774
:
166138
|
166139
|
166162
|
166163
|
166278
|
166303
|
166304
|
166305
|
166383
|
166384
|
166385
|
166395
|
166396
|
166423
|
166424
|
166425
|
166427
|
166463
|
166464