Trying to adjust top for clear time lines
This commit is contained in:
parent
e838719d46
commit
9981a5a5af
2 changed files with 86 additions and 117 deletions
|
|
@ -99,6 +99,7 @@ export class GridRenderer {
|
|||
}
|
||||
|
||||
timeAxisContent.appendChild(fragment);
|
||||
timeAxisContent.style.top = '-1px';
|
||||
timeAxis.appendChild(timeAxisContent);
|
||||
return timeAxis;
|
||||
}
|
||||
|
|
@ -176,62 +177,6 @@ export class GridRenderer {
|
|||
this.renderColumnContainer(columnContainer as HTMLElement, currentDate, resourceData, view);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup grid-only event listeners (column events)
|
||||
|
||||
private setupGridEventListeners(): void {
|
||||
// Setup grid body mouseover listener for all-day to timed conversion
|
||||
this.setupGridBodyMouseOver();
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* Setup grid body mouseover listener for all-day to timed conversion
|
||||
|
||||
private setupGridBodyMouseOver(): void {
|
||||
const grid = this.cachedGridContainer;
|
||||
if (!grid) return;
|
||||
|
||||
const columnContainer = grid.querySelector('swp-day-columns');
|
||||
if (!columnContainer) return;
|
||||
|
||||
// Throttle for better performance
|
||||
let lastEmitTime = 0;
|
||||
const throttleDelay = 16; // ~60fps
|
||||
|
||||
const gridBodyEventListener = (event: Event) => {
|
||||
const now = Date.now();
|
||||
if (now - lastEmitTime < throttleDelay) {
|
||||
return;
|
||||
}
|
||||
lastEmitTime = now;
|
||||
|
||||
const target = event.target as HTMLElement;
|
||||
const dayColumn = target.closest('swp-day-column');
|
||||
|
||||
if (dayColumn) {
|
||||
const targetColumn = (dayColumn as HTMLElement).dataset.date;
|
||||
if (targetColumn) {
|
||||
// Calculate Y position relative to the column
|
||||
const columnRect = dayColumn.getBoundingClientRect();
|
||||
const mouseY = (event as MouseEvent).clientY;
|
||||
const targetY = mouseY - columnRect.top;
|
||||
|
||||
eventBus.emit('column:mouseover', {
|
||||
targetColumn,
|
||||
targetY
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
columnContainer.addEventListener('mouseover', gridBodyEventListener);
|
||||
|
||||
// Store reference for cleanup
|
||||
(this as any).gridBodyEventListener = gridBodyEventListener;
|
||||
(this as any).cachedColumnContainer = columnContainer;
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* Create navigation grid container for slide animations
|
||||
* Now uses same implementation as initial load for consistency
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue