|
@@ -17,6 +17,8 @@
|
|
|
|
|
|
// tslint:disable:max-line-length
|
|
// tslint:disable:max-line-length
|
|
|
|
|
|
|
|
+import {WebClientService} from '../services/webclient';
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Support uploading and resizing avatar
|
|
* Support uploading and resizing avatar
|
|
*/
|
|
*/
|
|
@@ -27,12 +29,14 @@ export default [
|
|
'$timeout',
|
|
'$timeout',
|
|
'$translate',
|
|
'$translate',
|
|
'$mdDialog',
|
|
'$mdDialog',
|
|
|
|
+ 'WebClientService',
|
|
function($rootScope: ng.IRootScopeService,
|
|
function($rootScope: ng.IRootScopeService,
|
|
$log: ng.ILogService,
|
|
$log: ng.ILogService,
|
|
$window: ng.IWindowService,
|
|
$window: ng.IWindowService,
|
|
$timeout: ng.ITimeoutService,
|
|
$timeout: ng.ITimeoutService,
|
|
$translate: ng.translate.ITranslateService,
|
|
$translate: ng.translate.ITranslateService,
|
|
- $mdDialog: ng.material.IDialogService) {
|
|
|
|
|
|
+ $mdDialog: ng.material.IDialogService,
|
|
|
|
+ webClientService: WebClientService) {
|
|
return {
|
|
return {
|
|
restrict: 'EA',
|
|
restrict: 'EA',
|
|
scope: true,
|
|
scope: true,
|
|
@@ -82,6 +86,7 @@ export default [
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
controller: function() {
|
|
controller: function() {
|
|
this.avatar = null;
|
|
this.avatar = null;
|
|
|
|
+ this.avatarFormat = webClientService.appCapabilities.imageFormat.avatar;
|
|
|
|
|
|
this.apply = () => {
|
|
this.apply = () => {
|
|
$mdDialog.hide(this.avatar);
|
|
$mdDialog.hide(this.avatar);
|
|
@@ -142,7 +147,7 @@ export default [
|
|
md-diameter="96"></md-progress-circular>
|
|
md-diameter="96"></md-progress-circular>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
- <img ng-src="{{ ctrl.avatar | bufferToUrl:'image/png' }}" ng-if="ctrl.avatar !== null" />
|
|
|
|
|
|
+ <img ng-src="{{ ctrl.avatar | bufferToUrl:avatarFormat }}" ng-if="ctrl.avatar !== null" />
|
|
</div>
|
|
</div>
|
|
<div class="avatar-area-navigation" layout="row" layout-wrap layout-margin layout-align="center">
|
|
<div class="avatar-area-navigation" layout="row" layout-wrap layout-margin layout-align="center">
|
|
|
|
|