Refactors all-day event overflow toggle.
Simplifies the all-day event overflow toggle logic by using distinct class names and avoiding direct class switching, improving code readability and maintainability.
This commit is contained in:
parent
13b72b55b2
commit
0bf369907b
1 changed files with 11 additions and 8 deletions
|
|
@ -524,14 +524,17 @@ export class AllDayManager {
|
|||
this.isExpanded = !this.isExpanded;
|
||||
this.checkAndAnimateAllDayHeight();
|
||||
|
||||
|
||||
let elements = document.querySelectorAll('swp-allday-container swp-event : hasclass max-event-overflow-hide');
|
||||
elements.forEach(element: HTMLElement => {
|
||||
|
||||
element.classList.switch('max-event-overflow-hide', 'max-event-overflow-show');
|
||||
|
||||
}
|
||||
|
||||
let elements = document.querySelectorAll('swp-allday-container swp-event.max-event-overflow-hide, swp-allday-container swp-event.max-event-overflow-show');
|
||||
elements.forEach((element) => {
|
||||
if (element.classList.contains('max-event-overflow-hide')) {
|
||||
element.classList.remove('max-event-overflow-hide');
|
||||
element.classList.add('max-event-overflow-show');
|
||||
} else if (element.classList.contains('max-event-overflow-show')) {
|
||||
element.classList.remove('max-event-overflow-show');
|
||||
element.classList.add('max-event-overflow-hide');
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Count number of events in a specific column using ColumnBounds
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue