Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Set calendar height to 100%

Henriette Darge91873410eab4
diff --git a/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts b/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
index 9e2025840cc..4a7b565c6b3 100644
--- a/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
+++ b/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
@@ -122,7 +122,7 @@ export class WorkPackagesCalendarComponent extends UntilDestroyedMixin implement
.then(() => {
this.calendarOptions$.next(
this.calendar.calendarOptions({
- height: this.calendarHeight(),
+ height: '100%',
headerToolbar: this.buildHeader(),
events: this.calendarEventsFunction.bind(this),
plugins: [dayGridPlugin],
@@ -137,27 +137,6 @@ export class WorkPackagesCalendarComponent extends UntilDestroyedMixin implement
});
}
- private get calendarElement() {
- return jQuery(this.element.nativeElement).find('[data-qa-selector="op-wp-calendar"]');
- }
-
- private calendarHeight():number {
- if (this.static) {
- let heightElement = jQuery(this.element.nativeElement);
-
- while (!heightElement.height() && heightElement.parent()) {
- heightElement = heightElement.parent();
- }
-
- const topOfCalendar = jQuery(this.element.nativeElement).position().top;
- const topOfHeightElement = heightElement.position().top;
-
- return heightElement.height()! - (topOfCalendar - topOfHeightElement);
- }
- // -12 for the bottom padding
- return jQuery(window).height()! - this.calendarElement.offset()!.top - 12;
- }
-
public buildHeader():false|ToolbarInput|undefined {
if (this.static) {
return false;
diff --git a/frontend/src/app/features/calendar/wp-calendar/wp-calendar.sass b/frontend/src/app/features/calendar/wp-calendar/wp-calendar.sass
index 35a2586e1d9..7744959e3c0 100644
--- a/frontend/src/app/features/calendar/wp-calendar/wp-calendar.sass
+++ b/frontend/src/app/features/calendar/wp-calendar/wp-calendar.sass
@@ -2,8 +2,8 @@
// Ensure some sane min-height
// to ensure fullcalendar has something to render
min-height: 200px
+ height: 100%
&--notification
font-style: italic
margin-top: 0.5rem
-
diff --git a/frontend/src/global_styles/content/modules/_calendar.sass b/frontend/src/global_styles/content/modules/_calendar.sass
new file mode 100644
index 00000000000..9146a088ecf
--- /dev/null
+++ b/frontend/src/global_styles/content/modules/_calendar.sass
@@ -0,0 +1,3 @@
+.router--calendar
+ #content
+ height: 100%
diff --git a/frontend/src/global_styles/content/modules/_index.sass b/frontend/src/global_styles/content/modules/_index.sass
index 4b393435a12..5981374ff14 100644
--- a/frontend/src/global_styles/content/modules/_index.sass
+++ b/frontend/src/global_styles/content/modules/_index.sass
@@ -4,6 +4,7 @@
@import 'avatars'
@import 'bim'
@import 'boards'
+@import 'calendar'
@import 'costs'
@import 'documents'
@import '2fa'