Bugzilla – Attachment 124276 Details for
Bug 28928
Minor follow-ups to Bug 28376 - Flatpickr introduction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28928: Minor follow-ups to Bug 28376 - Flatpickr introduction
Bug-28928-Minor-follow-ups-to-Bug-28376---Flatpick.patch (text/plain), 3.90 KB, created by
Owen Leonard
on 2021-08-31 12:19:56 UTC
(
hide
)
Description:
Bug 28928: Minor follow-ups to Bug 28376 - Flatpickr introduction
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-08-31 12:19:56 UTC
Size:
3.90 KB
patch
obsolete
>From 77f5ae50fdf95856f80e58d92623e66aca04799e Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 31 Aug 2021 12:09:44 +0000 >Subject: [PATCH] Bug 28928: Minor follow-ups to Bug 28376 - Flatpickr > introduction > >This patch corrects three errors in the original Flatpickr introduction >patch: > >- Missing document.ready() in borrowers_stats.tt. >- Redundant calendarFirstDayOfWeek setting in caregories.js >- Missing preventDefault() in calendar.inc > >The first two issues don't appear to cause any malfunction but are best >practices. The third issue can cause the page to scroll unexpectedly. > >To reproduce this bug, go to (for instance) Administration -> Patron >categories -> New category. > > - If necessary, narrow the height of your browser window so that there > is a vertical scrollbar. > - Scroll down the page so that the "Until date" field is at the top. > - Click the "X" next to the field. > - The page will scroll to the top. > >Apply the patch and test again. The page jump should not occur. >--- > .../prog/en/includes/calendar.inc | 3 ++- > .../en/modules/reports/borrowers_stats.tt | 22 ++++++++++--------- > koha-tmpl/intranet-tmpl/prog/js/categories.js | 2 -- > 3 files changed, 14 insertions(+), 13 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index 9a6ed01497..93fae40cb7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -35,7 +35,8 @@ > .after( $("<a/>") > .attr("href","#") > .addClass("clear_date") >- .on("click", function(){ >+ .on("click", function(e){ >+ e.preventDefault(); > instance.clear(); > }) > .addClass("fa fa-fw fa-remove") >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt >index 93a28c4fe8..f08b356023 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt >@@ -331,16 +331,18 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'calendar.inc' %] > <script> >- var startPicker = $("#from").flatpickr({ >- onClose: function( selectedDates, dateText, instance) { >- validate_date( selectedDates, instance ); >- endPicker.set('minDate', selectedDates[0]); >- } >- }); >- var endPicker = $("#to").flatpickr({ >- onClose: function( selectedDates, dateText, instance) { >- validate_date( selectedDates, instance ); >- }, >+ $(document).ready(function(){ >+ var startPicker = $("#from").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ endPicker.set('minDate', selectedDates[0]); >+ } >+ }); >+ var endPicker = $("#to").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/categories.js b/koha-tmpl/intranet-tmpl/prog/js/categories.js >index 42d570e745..3ef44c3341 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/categories.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/categories.js >@@ -21,8 +21,6 @@ jQuery.validator.addMethod( "enrollment_period", function(){ > }, __("Please choose an enrollment period in months OR by date.") > ); > >-flatpickr.l10ns.default.firstDayOfWeek = calendarFirstDayOfWeek; >- > $(document).ready(function() { > KohaTable("patron_categories", { > "aoColumnDefs": [{ >-- >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 28928
:
124275
|
124276
|
124369