From 01bda0783c954e2be06a838681a20a3074eecad2 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 2 Oct 2019 09:20:35 -0400 Subject: [PATCH] (js) Optimize display of event editor --- .../UIxAppointmentEditorTemplate.wox | 6 +++--- .../js/Scheduler/ComponentController.js | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox index 86453c1e6..be7094cbd 100644 --- a/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox +++ b/UI/Templates/SchedulerUI/UIxAppointmentEditorTemplate.wox @@ -208,12 +208,12 @@
+ ng-if="editor.showRecurrenceEditor">
+ ng-if="editor.component.repeat.frequency != 'never'">
+ ng-if="editor.component.$hasAlarm">
diff --git a/UI/WebServerResources/js/Scheduler/ComponentController.js b/UI/WebServerResources/js/Scheduler/ComponentController.js index d5c4a690e..5ab35f1c5 100644 --- a/UI/WebServerResources/js/Scheduler/ComponentController.js +++ b/UI/WebServerResources/js/Scheduler/ComponentController.js @@ -388,14 +388,16 @@ }; this.changeAlarmRelation = function (form) { - if (this.component.type == 'task' && this.component.$hasAlarm && - (this.component.start || this.component.due) && - ((!this.component.start && this.component.alarm.relation == 'START') || - (!this.component.due && this.component.alarm.relation == 'END'))) { - form.alarmRelation.$setValidity('alarm', false); - } - else { - form.alarmRelation.$setValidity('alarm', true); + if (form.alarmRelation) { + if (this.component.type == 'task' && this.component.$hasAlarm && + (this.component.start || this.component.due) && + ((!this.component.start && this.component.alarm.relation == 'START') || + (!this.component.due && this.component.alarm.relation == 'END'))) { + form.alarmRelation.$setValidity('alarm', false); + } + else { + form.alarmRelation.$setValidity('alarm', true); + } } };