fix(calendar(js)): don't handle attendees for tasks
parent
ed300409b7
commit
ff3e83fd43
|
@ -210,19 +210,21 @@
|
||||||
var vm = this, component, oldStartDate, oldEndDate, oldDueDate, dayStartTime, dayEndTime;
|
var vm = this, component, oldStartDate, oldEndDate, oldDueDate, dayStartTime, dayEndTime;
|
||||||
|
|
||||||
this.$onInit = function () {
|
this.$onInit = function () {
|
||||||
stateComponent.initAttendees();
|
|
||||||
this.service = Calendar;
|
this.service = Calendar;
|
||||||
this.component = stateComponent;
|
this.component = stateComponent;
|
||||||
this.categories = {};
|
this.categories = {};
|
||||||
this.showRecurrenceEditor = this.component.$hasCustomRepeat;
|
this.showRecurrenceEditor = this.component.$hasCustomRepeat;
|
||||||
this.showAttendeesEditor = this.component.attendees && this.component.attendees.length;
|
this.showAttendeesEditor = this.component.attendees && this.component.attendees.length;
|
||||||
//this.searchText = null;
|
|
||||||
this.attendeeConflictError = false;
|
if (this.component.type == 'appointment') {
|
||||||
this.attendeesEditor = {
|
this.component.initAttendees();
|
||||||
days: this.component.$attendees.$days,
|
this.attendeeConflictError = false;
|
||||||
hours: getHours(),
|
this.attendeesEditor = {
|
||||||
containerElement: $element[0].querySelector('#freebusy')
|
days: this.component.$attendees.$days,
|
||||||
};
|
hours: getHours(),
|
||||||
|
containerElement: $element[0].querySelector('#freebusy')
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (this.component.start) {
|
if (this.component.start) {
|
||||||
oldStartDate = new Date(this.component.start.getTime());
|
oldStartDate = new Date(this.component.start.getTime());
|
||||||
|
@ -398,7 +400,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
function findSlot(direction) {
|
function findSlot(direction) {
|
||||||
|
vm.adjustStartTime();
|
||||||
|
vm.adjustEndTime();
|
||||||
vm.component.$attendees.findSlot(direction).then(function () {
|
vm.component.$attendees.findSlot(direction).then(function () {
|
||||||
|
vm.startTime = new Date(vm.component.start.getTime());
|
||||||
|
vm.endTime = new Date(vm.component.end.getTime());
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
vm.component.start = new Date(vm.component.start.getTime() + 1); // trigger update in sgFreeBusy
|
vm.component.start = new Date(vm.component.start.getTime() + 1); // trigger update in sgFreeBusy
|
||||||
$timeout(scrollToStart);
|
$timeout(scrollToStart);
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
} : null;
|
} : null;
|
||||||
},
|
},
|
||||||
function(newAttrs, oldAttrs) {
|
function(newAttrs, oldAttrs) {
|
||||||
if (newAttrs && newAttrs.attendees) {
|
if (newAttrs && newAttrs.attendees && newAttrs.attendees.length) {
|
||||||
// Attendees have changed
|
// Attendees have changed
|
||||||
$q.all(_.values($ctrl.component.$attendees.$futureFreebusyData)).then(function() {
|
$q.all(_.values($ctrl.component.$attendees.$futureFreebusyData)).then(function() {
|
||||||
$ctrl.onUpdate();
|
$ctrl.onUpdate();
|
||||||
|
|
Loading…
Reference in New Issue