Add background image placeholder in selection dialog

This commit is contained in:
Johannes Zellner
2022-05-25 21:27:52 +02:00
parent b0c423626a
commit 3a4c1b6ae7
2 changed files with 47 additions and 1 deletions
+7 -1
View File
@@ -249,6 +249,8 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
document.getElementById('mainContentContainer').style.backgroundImage = 'url("' + Client.getBackgroundImageUrl() + '")';
document.getElementById('mainContentContainer').classList.add('has-background');
$scope.user.hasBackgroundImage = true;
$('#backgroundImageChangeModal').modal('hide');
$scope.backgroundImageChange.reset();
});
@@ -261,6 +263,8 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
document.getElementById('mainContentContainer').style.backgroundImage = '';
document.getElementById('mainContentContainer').classList.remove('has-background');
$scope.user.hasBackgroundImage = false;
$('#backgroundImageChangeModal').modal('hide');
$scope.backgroundImageChange.reset();
});
@@ -274,7 +278,9 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
reset: function () {
$scope.backgroundImageChange.error.avatar = null;
document.getElementById('previewBackgroundImage').src = Client.getBackgroundImageUrl();
if ($scope.user.hasBackgroundImage) document.getElementById('previewBackgroundImage').src = Client.getBackgroundImageUrl();
else document.getElementById('previewBackgroundImage').src = '/img/background-image-placeholder.svg';
$scope.backgroundImageChange.pictureChanged = false;
$scope.backgroundImageChange.busy = false;
},