(js) Display the attendees editor automatically

pull/234/head
Francis Lachapelle 2017-03-10 14:48:53 -05:00
parent 19512a85d2
commit f60ffa923e
1 changed files with 4 additions and 1 deletions

View File

@ -218,7 +218,7 @@
vm.showRecurrenceEditor = vm.component.$hasCustomRepeat;
vm.toggleRecurrenceEditor = toggleRecurrenceEditor;
vm.recurrenceMonthDaysAreRequired = recurrenceMonthDaysAreRequired;
vm.showAttendeesEditor = false;
vm.showAttendeesEditor = vm.component.attendees && vm.component.attendees.length;
vm.toggleAttendeesEditor = toggleAttendeesEditor;
//vm.searchText = null;
vm.cardFilter = cardFilter;
@ -276,15 +276,18 @@
}
function addAttendee(card) {
var automaticallyExapand = (!vm.component.attendees || vm.component.attendees.length === 0);
if (angular.isString(card)) {
// User pressed "Enter" in search field, adding a non-matching card
if (card.isValidEmail()) {
vm.component.addAttendee(new Card({ emails: [{ value: card }] }));
vm.showAttendeesEditor |= automaticallyExapand;
vm.searchText = '';
}
}
else {
vm.component.addAttendee(card);
vm.showAttendeesEditor |= automaticallyExapand;
}
}