diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-07-26 12:13:26 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-07-26 12:15:09 +0200 |
commit | 09b3a322a8870c34d6a0a6bd8cc4f11856383991 (patch) | |
tree | c95ac2255bbf07cb4deb0349b8f4dc756359ca20 | |
parent | bb4c7114e18ebf73a5e0fb2ea03864d637ebf55f (diff) |
Changed the error indicator on the avatar in case of failure
Signed-off-by: John Molakvoæ (skjnldsv) skjnldsv@protonmail.com
-rw-r--r-- | css/public/style.css | 9 | ||||
-rw-r--r-- | js/components/contactDetails/contactDetails_controller.js | 3 | ||||
-rw-r--r-- | templates/avatar.html | 1 | ||||
-rw-r--r-- | templates/contactDetails.html | 2 |
4 files changed, 11 insertions, 4 deletions
diff --git a/css/public/style.css b/css/public/style.css index 423393d7..ec20a735 100644 --- a/css/public/style.css +++ b/css/public/style.css @@ -305,8 +305,13 @@ detailsitem.details-item-note label { detailsitem.failed { box-shadow: inset 2px 0 #c5173a; } -avatar.failed { - background-color: #c5173a; +avatar .icon-error { + position: absolute; + width: 100%; + height: 100% +} +avatar .icon-error + img { + opacity: 0.5; } /* Prevent delete for last adr/mail/tel item */ diff --git a/js/components/contactDetails/contactDetails_controller.js b/js/components/contactDetails/contactDetails_controller.js index cb7fa403..c7da9174 100644 --- a/js/components/contactDetails/contactDetails_controller.js +++ b/js/components/contactDetails/contactDetails_controller.js @@ -24,7 +24,8 @@ angular.module('contactsApp') selectField : t('contacts', 'Add field ...'), download : t('contacts', 'Download'), delete : t('contacts', 'Delete'), - save : t('contacts', 'Save changes') + save : t('contacts', 'Save changes'), + errorAvatarMessage : t('contacts', 'This photo as been recovered, please check the browser log for more informations.') }; ctrl.fieldDefinitions = vCardPropertiesService.fieldDefinitions; diff --git a/templates/avatar.html b/templates/avatar.html index 61dad7b6..5f7b1493 100644 --- a/templates/avatar.html +++ b/templates/avatar.html @@ -1,3 +1,4 @@ +<div ng-if="ctrl.contact.failedProps.indexOf('photo') !== -1" class="icon-error" uib-tooltip="{{ ctrl.t.errorMessage }}"></div> <img ng-show="contact.photo()!==undefined" class="contactdetails__logo avatar" id="contact-avatar" data-ng-src="{{contact.photo()}}" ng-click="ctrl.openPhoto()" /> <div class="avatar-options"> <input type="file" id="avatar-upload" class="hidden"/> diff --git a/templates/contactDetails.html b/templates/contactDetails.html index fc1af96e..f942d54e 100644 --- a/templates/contactDetails.html +++ b/templates/contactDetails.html @@ -8,7 +8,7 @@ </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, 'failed': ctrl.contact.failedProps.indexOf('photo') !== -1}"></avatar> + <avatar data="ctrl.contact" ng-class="{'avatar--missing': ctrl.contact.photo()===undefined}"></avatar> <div id="details-contact-infos"> <h2> <input type="text" id="details-fullName" class="contactdetails__name" placeholder="{{ctrl.t.placeholderName}}" autocomplete="off" autocorrect="off" spellcheck="false" |