From 830d5f9f3076986717b81b8436aa9d032f8fe248 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 31 Jan 2022 16:31:54 +0000 Subject: [PATCH] Bug 29212: (follow-up) Restore "Clear date" text for "Suspend all holds" This patch restores the "Clear date to suspend indefinitely" link associated with the "Suspend all holds" date input field. The patch also introduces a generic ".clear-flatpickr" click handler for Flatpickr instances. Signed-off-by: Fridolin Somers --- koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc | 8 ++++++++ koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc | 1 + koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 7 +------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc index 9793693a51..3a2fb12936 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc @@ -126,6 +126,14 @@ $(document).ready(function(){ $(".flatpickr").flatpickr(); + + $(".clear-flatpickr").on("click", function(e){ + e.preventDefault(); + var element = $(this).data("fp"); + if( element ){ + document.querySelector("#" + element )._flatpickr.clear(); + } + }); }); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc index f0b40d4f9f..2263737ec8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc @@ -175,6 +175,7 @@ [% IF AutoResumeSuspendedHolds %] +

Clear date to suspend indefinitely

[% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 8ef4dd18bb..45ce195e88 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -886,7 +886,7 @@ [% INCLUDE 'date-format.inc' %] -

Clear date to suspend indefinitely

+

Clear date to suspend indefinitely