Automatically store and remember the last selected filter item in the calendar page.

This commit is contained in:
Alex Tselegidis 2023-05-04 12:00:17 +02:00
parent bf3f2d7131
commit 0fbc3b906d

View file

@ -319,6 +319,8 @@ App.Utils.CalendarDefaultView = (function () {
} }
$reloadAppointments.trigger('click'); $reloadAppointments.trigger('click');
window.localStorage.setItem('EasyAppointments.SelectFilterItem', $selectFilterItem.val());
}); });
} }
@ -1658,6 +1660,12 @@ App.Utils.CalendarDefaultView = (function () {
.prop('selected', true); .prop('selected', true);
} }
const localSelectFilterItemValue = window.localStorage.getItem('EasyAppointments.SelectFilterItem');
if (localSelectFilterItemValue && $selectFilterItem.find(`option[value="${localSelectFilterItemValue}"]`).length) {
$selectFilterItem.val(localSelectFilterItemValue);
}
// Add the page event listeners. // Add the page event listeners.
addEventListeners(); addEventListeners();