mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 16:56:07 +00:00
UBER-888: fixed dragging of the WorkItem (#3730)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
parent
65c511ef77
commit
d6c3587ffb
@ -1124,3 +1124,14 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
min-width: 0;
|
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; }
|
||||||
|
}
|
||||||
|
@ -60,6 +60,10 @@
|
|||||||
}
|
}
|
||||||
const rem = (n: number): number => n * fontSize
|
const rem = (n: number): number => n * fontSize
|
||||||
|
|
||||||
|
export function getCalendarRect (): DOMRect | undefined {
|
||||||
|
return container ? calendarRect : undefined
|
||||||
|
}
|
||||||
|
|
||||||
const offsetTZ = new Date().getTimezoneOffset() * 60 * 1000
|
const offsetTZ = new Date().getTimezoneOffset() * 60 * 1000
|
||||||
|
|
||||||
const toCalendar = (
|
const toCalendar = (
|
||||||
@ -510,7 +514,7 @@
|
|||||||
let dragOnOld: CalendarCell | null = null
|
let dragOnOld: CalendarCell | null = null
|
||||||
|
|
||||||
const getMinutes = (e: MouseEvent): number => (e.offsetY >= cellHeight / 2 ? 30 : 0)
|
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 = {
|
const dragOn: CalendarCell = {
|
||||||
day,
|
day,
|
||||||
hourOfDay,
|
hourOfDay,
|
||||||
@ -528,6 +532,7 @@
|
|||||||
dispatch('dragenter', {
|
dispatch('dragenter', {
|
||||||
date: new Date(day.setHours(hourOfDay + startHour, dragOn.minutes, 0, 0))
|
date: new Date(day.setHours(hourOfDay + startHour, dragOn.minutes, 0, 0))
|
||||||
})
|
})
|
||||||
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -537,6 +542,7 @@
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
bind:this={container}
|
bind:this={container}
|
||||||
|
on:dragleave
|
||||||
class="calendar-container"
|
class="calendar-container"
|
||||||
style:--calendar-ad-height={styleAD + 'px'}
|
style:--calendar-ad-height={styleAD + 'px'}
|
||||||
style:grid={`${showHeader ? '[header] 3.5rem ' : ''}[all-day] ${styleAD}px repeat(${
|
style:grid={`${showHeader ? '[header] 3.5rem ' : ''}[all-day] ${styleAD}px repeat(${
|
||||||
|
Loading…
Reference in New Issue
Block a user