parent
b0e59f9ac9
commit
e375575436
|
@ -236,7 +236,8 @@
|
|||
ng-show="editor.component.start || editor.component.due">
|
||||
<!-- reminder -->
|
||||
<md-checkbox ng-model="editor.component.$hasAlarm"
|
||||
label:aria-label="Reminder">
|
||||
label:aria-label="Reminder"
|
||||
ng-change="editor.onAlarmChange(eventForm)">
|
||||
<var:string label:value="Reminder"/>
|
||||
</md-checkbox>
|
||||
<div flex-offset="5"
|
||||
|
|
|
@ -358,7 +358,7 @@
|
|||
}
|
||||
|
||||
function changeAlarmRelation(form) {
|
||||
if (vm.component.type == 'task' &&
|
||||
if (vm.component.type == 'task' && vm.component.$hasAlarm &&
|
||||
((!vm.component.start && vm.component.alarm.relation == 'START') ||
|
||||
(!vm.component.due && vm.component.alarm.relation == 'END'))) {
|
||||
form.alarmRelation.$setValidity('alarm', false);
|
||||
|
@ -368,7 +368,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
function onAlarmChange(event) {
|
||||
function onAlarmChange(form) {
|
||||
if (vm.component.type !== 'task') {
|
||||
return;
|
||||
}
|
||||
|
@ -377,6 +377,7 @@
|
|||
} else if (!vm.component.due && vm.component.alarm.relation == 'END') {
|
||||
vm.component.alarm.relation = 'START';
|
||||
}
|
||||
changeAlarmRelation(form);
|
||||
}
|
||||
|
||||
function save(form, options) {
|
||||
|
|
Loading…
Reference in New Issue