mirror of
https://github.com/tutao/tutanota.git
synced 2025-10-19 16:03:43 +00:00
wip...
This commit is contained in:
parent
5e17ba5820
commit
2dc04fe8bc
1 changed files with 24 additions and 4 deletions
|
@ -388,13 +388,33 @@ export class TimeView implements Component<TimeViewAttributes> {
|
||||||
} else {
|
} else {
|
||||||
size = Math.floor(maxSize / (numOfColumnsWithBlockers + 1)) - (columnIndex + 1)
|
size = Math.floor(maxSize / (numOfColumnsWithBlockers + 1)) - (columnIndex + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let i = columnIndex + 1
|
||||||
|
while (i < columnIndex + size) {
|
||||||
|
if (i >= allColumns.length) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
const hasConflict = Array.from(allColumns[i].events.entries()).filter(([evId, eventData]) => {
|
||||||
|
const overlapRows = eventData.rowStart < eventRowData.rowEnd && eventData.rowEnd > eventRowData.rowStart
|
||||||
|
const blockers = this.blockingGroups.get(eventId) ?? []
|
||||||
|
const alreadyInBlockers = blockers.some((e) => e.has(evId))
|
||||||
|
|
||||||
|
return !alreadyInBlockers && overlapRows
|
||||||
|
})
|
||||||
|
|
||||||
|
if (hasConflict.length > 0) {
|
||||||
|
size -= Math.abs(i - columnIndex)
|
||||||
|
i = columnIndex + 1
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
i++
|
||||||
|
}
|
||||||
//iterate over blockers
|
//iterate over blockers
|
||||||
for (const blockerGroup of this.blockingGroups.get(eventId) ?? []) {
|
for (const blockerGroup of this.blockingGroups.get(eventId) ?? []) {
|
||||||
for (const blocker of blockerGroup.keys()) {
|
for (const blocker of blockerGroup.keys()) {
|
||||||
const blockerShiftInfo = blockerShift.get(blocker)
|
const blockerShiftInfo = blockerShift.get(blocker) ?? 0
|
||||||
if (blockerShiftInfo == null || blockerShiftInfo > size) {
|
blockerShift.set(blocker, blockerShiftInfo + size)
|
||||||
blockerShift.set(blocker, size)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue