Improves all-day event drag and drop
Refactors all-day event conversion during drag and drop to use the event payload, improving code clarity and reducing redundancy. Removes unnecessary style settings and fixes column detection logic. Addresses an issue where event removal occurred before successful placement.
This commit is contained in:
parent
8b5420f367
commit
83e01f9cb7
7 changed files with 29 additions and 49 deletions
|
|
@ -274,20 +274,6 @@ swp-day-header[data-today="true"] swp-day-date {
|
|||
margin: 4px auto 0;
|
||||
}
|
||||
|
||||
|
||||
/* All-day container - initially hidden, animated in when first event is dragged */
|
||||
swp-allday-container {
|
||||
grid-column: 1 / -1; /* Span all columns */
|
||||
grid-row: 2; /* Second row of calendar header */
|
||||
display: grid;
|
||||
grid-template-columns: repeat(var(--grid-columns, 7), minmax(var(--day-column-min-width), 1fr));
|
||||
grid-template-rows: repeat(1, auto); /* Default to 1 row, dynamically updated by JS */
|
||||
gap: 2px;
|
||||
padding: 2px;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Ghost columns for mouseenter events */
|
||||
swp-allday-column {
|
||||
position: relative;
|
||||
|
|
@ -299,8 +285,7 @@ swp-allday-column {
|
|||
}
|
||||
|
||||
/* All-day events in containers */
|
||||
swp-allday-container swp-event,
|
||||
swp-event.all-day-style {
|
||||
swp-allday-container swp-event {
|
||||
height: 22px !important; /* Fixed height for consistent stacking */
|
||||
position: relative !important;
|
||||
width: auto !important;
|
||||
|
|
@ -308,13 +293,11 @@ swp-event.all-day-style {
|
|||
right: auto !important;
|
||||
top: auto !important;
|
||||
padding: 2px 4px;
|
||||
margin-bottom: 2px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
background: #ff9800; /* Default orange background */
|
||||
background: hsl(208, 100%, 50%);
|
||||
display: flex;
|
||||
position: relative;
|
||||
z-index: 2; /* Above ghost columns */
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
|
|
@ -326,11 +309,11 @@ swp-event.all-day-style {
|
|||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
border-left: 3px solid rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
swp-allday-container swp-event:last-child,
|
||||
swp-event.all-day-style:last-child {
|
||||
margin-bottom: 0;
|
||||
&.dragging {
|
||||
background: lab(70.24% -13.38 -46.17);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Hide time element for all-day styled events */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue