Improve attendees display in event editor

Fixes #3730
This commit is contained in:
Francis Lachapelle
2016-06-16 16:08:21 -04:00
parent 734d680708
commit 429aa1a91d
2 changed files with 22 additions and 22 deletions
@@ -251,25 +251,27 @@
<md-icon ng-class="{'md-rotate-180': editor.showAttendeesEditor}">expand_more</md-icon>
</md-button>
</div>
<!-- md-contact-chips don't support "readonly", so we build them using md-chips
in readonly mode and a template similar to the one of md-contact-chips -->
<md-chips class="ng-hide md-contact-chips sg-readonly attendees-chips"
ng-model="editor.component.attendees"
ng-hide="editor.showAttendeesEditor"
readonly="true">
<md-chip-template>
<div class="md-contact-avatar">
<sg-avatar-image sg-email="$chip.email" size="32"><!-- avatar --></sg-avatar-image>
</div>
<div class="md-contact-name">{{$chip.name || $chip.email}}</div>
<md-icon ng-class="'icon-' + $chip.status"><!-- partstat --></md-icon>
<md-icon class="sg-chip-remove"
label:aria-label="Delete"
ng-click="editor.removeAttendee($chip)">close</md-icon>
</md-chip-template>
</md-chips>
<div class="ng-hide attendees" ng-show="editor.showAttendeesEditor">
<var:component className="UIxAttendeesEditor" />
<div ng-show="editor.component.attendees.length">
<!-- md-contact-chips don't support "readonly", so we build them using md-chips
in readonly mode and a template similar to the one of md-contact-chips -->
<md-chips class="ng-hide md-contact-chips sg-readonly attendees-chips"
ng-model="editor.component.attendees"
ng-hide="editor.showAttendeesEditor"
readonly="true">
<md-chip-template>
<div class="md-contact-avatar">
<sg-avatar-image sg-email="$chip.email" size="32"><!-- avatar --></sg-avatar-image>
</div>
<div class="md-contact-name">{{$chip.name || $chip.email}}</div>
<md-icon ng-class="'icon-' + $chip.status"><!-- partstat --></md-icon>
<md-icon class="sg-chip-remove"
label:aria-label="Delete"
ng-click="editor.removeAttendee($chip)">close</md-icon>
</md-chip-template>
</md-chips>
<div class="ng-hide attendees" ng-show="editor.showAttendeesEditor">
<var:component className="UIxAttendeesEditor" />
</div>
</div>
</div>
<div class="sg-form-section">
@@ -218,7 +218,7 @@
vm.categories = {};
vm.showRecurrenceEditor = vm.component.$hasCustomRepeat;
vm.toggleRecurrenceEditor = toggleRecurrenceEditor;
vm.showAttendeesEditor = angular.isDefined(vm.component.attendees);
vm.showAttendeesEditor = false;
vm.toggleAttendeesEditor = toggleAttendeesEditor;
//vm.searchText = null;
vm.cardFilter = cardFilter;
@@ -276,13 +276,11 @@
// User pressed "Enter" in search field, adding a non-matching card
if (card.isValidEmail()) {
vm.component.addAttendee(new Card({ emails: [{ value: card }] }));
vm.showAttendeesEditor = true;
vm.searchText = '';
}
}
else {
vm.component.addAttendee(card);
vm.showAttendeesEditor = true;
}
}