|
|
@ -16,7 +16,7 @@ global.checkAll = (id, checked) => {
|
|
|
|
* Sets the checkboxes according to the given type
|
|
|
|
* Sets the checkboxes according to the given type
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param {string} id The elements ID
|
|
|
|
* @param {string} id The elements ID
|
|
|
|
* @param {list} shifts_list A list of numbers
|
|
|
|
* @param {list} shiftsList A list of numbers
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
global.checkOwnTypes = (id, shiftsList) => {
|
|
|
|
global.checkOwnTypes = (id, shiftsList) => {
|
|
|
|
$('#' + id + ' input[type="checkbox"]').each(function () {
|
|
|
|
$('#' + id + ' input[type="checkbox"]').each(function () {
|
|
|
@ -173,3 +173,30 @@ $(function () {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Set the filter selects to latest state
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Uses DOMContentLoaded to prevent flickering
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
|
|
|
const filter = document.getElementById('collapseShiftsFilterSelect');
|
|
|
|
|
|
|
|
if (!filter || localStorage.getItem('collapseShiftsFilterSelect') !== 'hidden') {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
filter.classList.remove('in');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$(() => {
|
|
|
|
|
|
|
|
if (typeof (localStorage) === 'undefined') {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onChange = (e) => {
|
|
|
|
|
|
|
|
localStorage.setItem('collapseShiftsFilterSelect', e.type);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#collapseShiftsFilterSelect')
|
|
|
|
|
|
|
|
.on('hidden.bs.collapse', onChange)
|
|
|
|
|
|
|
|
.on('shown.bs.collapse', onChange);
|
|
|
|
|
|
|
|
});
|
|
|
|