diff --git a/src/components/CalendarComponent.ts b/src/components/CalendarComponent.ts index 5b07615..4f302d6 100644 --- a/src/components/CalendarComponent.ts +++ b/src/components/CalendarComponent.ts @@ -54,6 +54,9 @@ export class CalendarComponent { this.currentViewedDate = match[0]; } } + + // Add the fixed position class for markdown views + this.component.addClass('stream-calendar-component-fixed'); } else if (viewType === CREATE_FILE_VIEW_TYPE) { // Cast to unknown first, then to ViewWithContentEl to avoid TypeScript errors const view = leaf.view as unknown as ViewWithContentEl; @@ -69,10 +72,16 @@ export class CalendarComponent { } catch (error) { this.log.error('Error getting date from CreateFileView state:', error); } + + // Don't add fixed position class for create file view + // The CSS will correctly position it via .streams-create-file-container .stream-calendar-component } else { // Cast to unknown first, then to ViewWithContentEl to avoid TypeScript errors const view = leaf.view as unknown as ViewWithContentEl; contentContainer = view.contentEl; + + // Add the fixed position class for other view types + this.component.addClass('stream-calendar-component-fixed'); } if (!contentContainer) { @@ -82,8 +91,6 @@ export class CalendarComponent { contentContainer.addClass('markdown-view-content'); - this.component.addClass('stream-calendar-component-fixed'); - contentContainer.appendChild(this.component); this.fileModifyHandler = this.handleFileModify.bind(this); diff --git a/styles.css b/styles.css index c5e27a4..e9dba01 100644 --- a/styles.css +++ b/styles.css @@ -160,10 +160,11 @@ } .streams-create-file-container .stream-calendar-component { - position: fixed; - top: 80px; - right: 0; + position: absolute; + top: 5px; + right: 16px; margin-right: 0; + z-index: 1000; } .stream-calendar-collapsed {