Преглед изворни кода

AvatarArea directive: Fix image buffer parsing

Danilo Bargen пре 7 година
родитељ
комит
8d97edbca3
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/directives/avatar_area.ts

+ 2 - 2
src/directives/avatar_area.ts

@@ -50,6 +50,7 @@ export default [
             controller: [function() {
                 this.isLoading = false;
                 this.avatar = null; // Type: String
+                this.avatarFormat = webClientService.appCapabilities.imageFormat.avatar;
 
                 this.imageChanged = function(image: ArrayBuffer, notify = true) {
                     this.isLoading = true;
@@ -86,7 +87,6 @@ export default [
                         controllerAs: 'ctrl',
                         controller: function() {
                             this.avatar = null;
-                            this.avatarFormat = webClientService.appCapabilities.imageFormat.avatar;
 
                             this.apply = () => {
                                 $mdDialog.hide(this.avatar);
@@ -147,7 +147,7 @@ export default [
                                     md-diameter="96"></md-progress-circular>
 
                         </div>
-                        <img ng-src="{{ ctrl.avatar | bufferToUrl:avatarFormat }}" ng-if="ctrl.avatar !== null" />
+                        <img ng-src="{{ ctrl.avatar|bufferToUrl:ctrl.avatarFormat }}" ng-if="ctrl.avatar !== null" />
                     </div>
                     <div class="avatar-area-navigation"  layout="row" layout-wrap layout-margin layout-align="center">