mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-06 16:53:34 +02:00
fixes #2117 add a condition to the date-end onChange function
in the date-end OnChange event, before launching the function that will make the ajax request, we check that the `end` parameter is not "1899-12-31".
This commit is contained in:
@@ -47,12 +47,16 @@ $(document).ready(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('.date-end').on("change", function () {
|
$('.date-end').on("change", function () {
|
||||||
console.log($('.date-end input[name="end"]').attr("value"));
|
const newValue = $('.date-end input[name="end"]').attr("value");
|
||||||
if (current_param.end != $('.date-end input[name="end"]').attr("value")) {
|
if (current_param.end != newValue) {
|
||||||
console.log("HERE");
|
|
||||||
current_param.end = $('.date-end input[name="end"]').attr("value");
|
current_param.end = $('.date-end input[name="end"]').attr("value");
|
||||||
current_param.pageNumber = 0;
|
current_param.pageNumber = 0;
|
||||||
fillHistoryResult(current_param);
|
// The datepicker first fills the end-date with '1899-12-31',
|
||||||
|
// which triggers an unnecessary ajax request
|
||||||
|
// when you come to the history search page from a photo.
|
||||||
|
if (newValue !== '1899-12-31') {
|
||||||
|
fillHistoryResult(current_param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user