UBER-888: fixed dragging of the WorkItem (#3730)

Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
Alexander Platov 2023-09-22 09:09:37 +03:00 committed by GitHub
parent 65c511ef77
commit d6c3587ffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View File

@ -1124,3 +1124,14 @@
align-items: center;
min-width: 0;
}
/* Tasks in Calendar (WorkSlot) */
.tasksGroup-container .task-item.dragged {
overflow: hidden;
background-color: var(--theme-bg-color);
border-color: var(--theme-divider-color);
border-radius: .125rem;
opacity: .75;
.task-icon { opacity: 0; }
}

View File

@ -60,6 +60,10 @@
}
const rem = (n: number): number => n * fontSize
export function getCalendarRect (): DOMRect | undefined {
return container ? calendarRect : undefined
}
const offsetTZ = new Date().getTimezoneOffset() * 60 * 1000
const toCalendar = (
@ -510,7 +514,7 @@
let dragOnOld: CalendarCell | null = null
const getMinutes = (e: MouseEvent): number => (e.offsetY >= cellHeight / 2 ? 30 : 0)
const dragOver = (e: MouseEvent, day: Date, hourOfDay: number) => {
const dragOver = (e: DragEvent & { currentTarget: EventTarget & HTMLDivElement }, day: Date, hourOfDay: number) => {
const dragOn: CalendarCell = {
day,
hourOfDay,
@ -528,6 +532,7 @@
dispatch('dragenter', {
date: new Date(day.setHours(hourOfDay + startHour, dragOn.minutes, 0, 0))
})
e.preventDefault()
}
</script>
@ -537,6 +542,7 @@
>
<div
bind:this={container}
on:dragleave
class="calendar-container"
style:--calendar-ad-height={styleAD + 'px'}
style:grid={`${showHeader ? '[header] 3.5rem ' : ''}[all-day] ${styleAD}px repeat(${