Bugzilla – Attachment 130019 Details for
Bug 29212
Use Flatpickr on OPAC pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29212: (follow-up) Restore "Clear date" text for "Suspend all holds"
Bug-29212-follow-up-Restore-Clear-date-text-for-Su.patch (text/plain), 3.55 KB, created by
Owen Leonard
on 2022-01-31 16:37:40 UTC
(
hide
)
Description:
Bug 29212: (follow-up) Restore "Clear date" text for "Suspend all holds"
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-01-31 16:37:40 UTC
Size:
3.55 KB
patch
obsolete
>From e58840137fca9999dab4eb34f34163c008e60a80 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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. >--- > 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(); >+ } >+ }); > }); > > </script> >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 %] > <label for="suspend_until"> until </label> > <input type="text" name="suspend_until" id="suspend_until" class="flatpickr futuredate" size="10" /> >+ <p><a href="#" class="clear-flatpickr" data-fp="suspend_until">Clear date to suspend indefinitely</a></p> > [% END %] > </form> > </div> >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 @@ > <label for="suspend_untilDate">Suspend until:</label> > <input type="text" name="suspend_until" id="suspend_untilDate" size="10" /> > [% INCLUDE 'date-format.inc' %] >- <p><a href="#" id="suspend-modal-clear-date">Clear date to suspend indefinitely</a></p> >+ <p><a href="#" class="clear-flatpickr" data-fp="suspend_untilDate">Clear date to suspend indefinitely</a></p> > </div> > <div class="modal-footer"> > <button class="btn btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Suspend</button> >@@ -987,11 +987,6 @@ > $("#suspendHoldModal").modal("show"); > }); > >- $("#suspend-modal-clear-date").on( "click", function(e) { >- e.preventDefault(); >- suspend_until_date.clear(); >- }); >- > $("#suspendHoldModal").on("hidden.bs.modal", function(){ > $("#suspendHoldTitle").html(""); > $("#suspendHoldReserveId").val(""); >-- >2.20.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 29212
:
126229
|
126290
|
126298
|
126299
|
126820
|
126824
|
126825
|
126826
|
127250
|
129620
|
129638
|
129639
|
129640
|
129641
|
129642
| 130019