From 3e2e564aa5bbfcb7e67c1e7a17f5208f75649fa4 Mon Sep 17 00:00:00 2001 From: Kobe Mertens Date: Mon, 30 Dec 2024 11:54:12 +0100 Subject: [PATCH] disable calendar if timesheet is exported --- app/components/full-calendar.hbs | 2 +- app/components/full-calendar.js | 8 +++++++- app/templates/year/month.hbs | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/components/full-calendar.hbs b/app/components/full-calendar.hbs index f88ce50..5db9ad1 100644 --- a/app/components/full-calendar.hbs +++ b/app/components/full-calendar.hbs @@ -22,8 +22,8 @@ {{/if}}
\ No newline at end of file diff --git a/app/components/full-calendar.js b/app/components/full-calendar.js index abbaac3..f9b58ac 100644 --- a/app/components/full-calendar.js +++ b/app/components/full-calendar.js @@ -57,7 +57,9 @@ export default class FullCalendarComponent extends Component { select: this.args.isDisabled ? () => false : this.onSelect.bind(this), unselect: this.args.isDisabled ? () => false : this.onUnselect.bind(this), dayCellContent: this.renderDayCellContent.bind(this), - eventDidMount: this.attachEventRemoveButton.bind(this), + eventDidMount: this.args.isDisabled + ? undefined + : this.attachEventRemoveButton.bind(this), eventClick: this.args.isDisabled ? () => false : this.onEventClick.bind(this), @@ -241,6 +243,10 @@ export default class FullCalendarComponent extends Component { this.args.isDisabled ? () => false : this.onUnselect.bind(this), ); this.calendar.setOption('selectable', !this.args.isDisabled); + this.calendar.setOption( + 'eventDidMount', + this.args.isDisabled ? undefined : this.attachEventRemoveButton.bind(this), + ); } save = ecTask(async (hourTaskPairs) => { diff --git a/app/templates/year/month.hbs b/app/templates/year/month.hbs index 47bfbed..0aeb0c3 100644 --- a/app/templates/year/month.hbs +++ b/app/templates/year/month.hbs @@ -1,6 +1,6 @@