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. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
80b8c6e225
commit
1bd10a4a2e
3 changed files with 14 additions and 13 deletions
|
@ -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")
|
||||
|
|
|
@ -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 %]
|
||||
|
|
|
@ -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": [{
|
||||
|
|
Loading…
Reference in a new issue