forked from mirrors/easyappointments
Automatically store and remember the last selected filter item in the calendar page.
This commit is contained in:
parent
bf3f2d7131
commit
0fbc3b906d
1 changed files with 10 additions and 2 deletions
|
@ -319,6 +319,8 @@ App.Utils.CalendarDefaultView = (function () {
|
|||
}
|
||||
|
||||
$reloadAppointments.trigger('click');
|
||||
|
||||
window.localStorage.setItem('EasyAppointments.SelectFilterItem', $selectFilterItem.val());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1111,8 +1113,8 @@ App.Utils.CalendarDefaultView = (function () {
|
|||
.find('.btn')
|
||||
.css('width', 'calc(50% - 10px)');
|
||||
|
||||
fullCalendar.unselect();
|
||||
|
||||
fullCalendar.unselect();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1658,6 +1660,12 @@ App.Utils.CalendarDefaultView = (function () {
|
|||
.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.
|
||||
addEventListeners();
|
||||
|
||||
|
|
Loading…
Reference in a new issue