Mobile compatibility, and removed unnecessary settings
This commit is contained in:
parent
098844ef7b
commit
57463e3865
4 changed files with 88 additions and 29 deletions
22
app.js
22
app.js
|
|
@ -10,8 +10,7 @@ const state = {
|
|||
const settingKeys = [
|
||||
'previous_months', 'future_months',
|
||||
'vacation_days_per_month', 'feriefridage_per_year', 'feriefridage_expiry_month',
|
||||
'normal_day_hours', 'friday_hours', 'opening_vacation_days',
|
||||
'opening_feriefridage_days', 'opening_flex_hours'
|
||||
'normal_day_hours', 'friday_hours'
|
||||
];
|
||||
|
||||
const monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
||||
|
|
@ -315,6 +314,25 @@ function renderPlanner() {
|
|||
document.querySelectorAll('.balance-override-input').forEach((input) => {
|
||||
input.addEventListener('change', (event) => saveBalanceOverride(event).catch((error) => toast(error.message || String(error))));
|
||||
});
|
||||
syncPlannerScroll();
|
||||
}
|
||||
|
||||
function syncPlannerScroll() {
|
||||
const headerWrap = document.querySelector('.planner-column-header.table-wrap');
|
||||
const bodyWrap = document.querySelector('.planner-panel .table-wrap');
|
||||
if (!headerWrap || !bodyWrap) return;
|
||||
|
||||
let syncing = false;
|
||||
const sync = (from, to) => {
|
||||
if (syncing) return;
|
||||
syncing = true;
|
||||
to.scrollLeft = from.scrollLeft;
|
||||
requestAnimationFrame(() => { syncing = false; });
|
||||
};
|
||||
|
||||
headerWrap.addEventListener('scroll', () => sync(headerWrap, bodyWrap), { passive: true });
|
||||
bodyWrap.addEventListener('scroll', () => sync(bodyWrap, headerWrap), { passive: true });
|
||||
headerWrap.scrollLeft = bodyWrap.scrollLeft;
|
||||
}
|
||||
|
||||
function renderMonthRow(month) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue