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());
}); });
} }
@ -1111,8 +1113,8 @@ App.Utils.CalendarDefaultView = (function () {
.find('.btn') .find('.btn')
.css('width', 'calc(50% - 10px)'); .css('width', 'calc(50% - 10px)');
fullCalendar.unselect(); fullCalendar.unselect();
return false; return false;
} }
@ -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();