فهرست منبع

Revert "Do not apply the receiver's color as background color (#864)"

This reverts commit 8ad24d996bda57290fc61fe808b3fa9b6f3569ba.

Unfortunately it has unwanted side effects (all avatars lose background
color).
Danilo Bargen 6 سال پیش
والد
کامیت
c96013c60a
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      src/directives/avatar.ts

+ 4 - 0
src/directives/avatar.ts

@@ -118,6 +118,7 @@ export default [
                     // Set initial values
                     this.highResolution = this.resolution === 'high';
                     this.isLoading = this.highResolution;
+                    this.backgroundColor = receiver.color;
                     this.receiverName = receiver.displayName;
                 };
 
@@ -139,6 +140,8 @@ export default [
                             return false;
                         }
                         this.isLoading = false;
+                        // Reset background color
+                        this.backgroundColor = null;
                         return true;
                     };
 
@@ -276,6 +279,7 @@ export default [
                     </div>
                     <img
                          ng-class="ctrl.avatarClass()"
+                         ng-style="{ 'background-color': ctrl.backgroundColor }"
                          ng-src="{{ ctrl.getAvatarUri() }}"
                          in-view="ctrl.requestAvatar($inview)"
                          aria-label="avatar {{ ctrl.receiverName }}">