Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2017-09-21 07:07:11 +02:00
parent 9f805bdf4a
commit 7fda82f86a
No known key found for this signature in database
GPG Key ID: FB5ACEED51955BF8
3 changed files with 18 additions and 6 deletions

View File

@ -1,6 +1,7 @@
.contact-details-wrapper {
position: relative;
background: $color-main-background;
min-height: 100%;
}
.wrapper-show {

View File

@ -3,7 +3,8 @@ angular.module('contactsApp')
var ctrl = this;
ctrl.loading = true;
ctrl.init = true;
ctrl.loading = false;
ctrl.show = false;
ctrl.clearContact = function() {
@ -25,7 +26,8 @@ angular.module('contactsApp')
download : t('contacts', 'Download'),
delete : t('contacts', 'Delete'),
save : t('contacts', 'Save changes'),
addressBook : t('contacts', 'Address book')
addressBook : t('contacts', 'Address book'),
loading : t('contacts', 'Waiting for the contact list to load...')
};
ctrl.fieldDefinitions = vCardPropertiesService.fieldDefinitions;
@ -41,7 +43,7 @@ angular.module('contactsApp')
return book.displayName === ctrl.contact.addressBookId;
});
}
ctrl.loading = false;
ctrl.init = false;
// Start watching for ctrl.uid when we have addressBooks, as they are needed for fetching
// full details.
$scope.$watch('ctrl.uid', function(newValue) {
@ -56,6 +58,7 @@ angular.module('contactsApp')
$('#app-navigation-toggle').removeClass('showdetails');
return;
}
ctrl.loading = true;
ContactService.getById(ctrl.addressBooks, uid).then(function(contact) {
if (angular.isUndefined(contact)) {
ctrl.clearContact();
@ -63,6 +66,7 @@ angular.module('contactsApp')
}
ctrl.contact = contact;
ctrl.show = true;
ctrl.loading = false;
$('#app-navigation-toggle').addClass('showdetails');
ctrl.addressBook = _.find(ctrl.addressBooks, function(book) {

View File

@ -1,11 +1,18 @@
<div class="contact-details-wrapper wrapper-show" ng-class="{'mobile-show':ctrl.show}">
<div class="contact-details-wrapper wrapper-show"
ng-class="{'mobile-show': ctrl.show, 'icon-loading': ctrl.loading}">
<div id="app-navigation-toggle-back" class="details-back icon-download" ng-click="ctrl.clearContact()"></div>
<div ng-if="ctrl.contact===undefined && !ctrl.loading">
<div id="emptycontent" class="">
<div ng-if="ctrl.contact===undefined && !ctrl.loading && !ctrl.init">
<div id="emptycontent">
<div class="icon-contacts-dark"></div>
<h2>{{ctrl.t.noContacts}}</h2>
</div>
</div>
<div ng-if="ctrl.init">
<div id="emptycontent">
<div class="icon-contacts-dark"></div>
<h2>{{ctrl.t.loading}}</h2>
</div>
</div>
<div ng-if="ctrl.contact!==undefined">
<header class="contactdetails__header" ng-style="{'background-color': (ctrl.contact.uid() | contactColor)}">
<avatar data="ctrl.contact" ng-class="{'avatar--missing': ctrl.contact.photo()===undefined}"></avatar>