Revert "dashboard: first use profile background if not exist try branding background"

This reverts commit 8db6da2de9.
This commit is contained in:
Johannes Zellner
2024-04-06 10:00:16 +02:00
parent 91d9f66eb8
commit 32d9490856
4 changed files with 23 additions and 39 deletions
+1 -3
View File
@@ -268,9 +268,7 @@ angular.module('Application').controller('BrandingController', ['$scope', '$loca
$scope.about.avatar = null;
$scope.about.refresh();
Client.refreshBranding(function () {
$scope.about.busy = false;
});
$scope.about.busy = false;
});
});
});
+12 -11
View File
@@ -247,13 +247,13 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
Client.setBackgroundImage(imageFile, function (error) {
if (error) return console.error('Unable to change backgroundImage.', error);
Client.refreshBranding(function () {
$scope.user.hasBackgroundImage = true;
document.getElementById('mainContentContainer').style.backgroundImage = 'url("' + Client.getBackgroundImageUrl() + '")';
document.getElementById('mainContentContainer').classList.add('has-background');
$('#backgroundImageChangeModal').modal('hide');
$scope.user.hasBackgroundImage = true;
$scope.backgroundImageChange.reset();
});
$('#backgroundImageChangeModal').modal('hide');
$scope.backgroundImageChange.reset();
});
},
@@ -261,12 +261,13 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
Client.setBackgroundImage(null, function (error) {
if (error) return console.error('Unable to change backgroundImage.', error);
Client.refreshBranding(function () {
$scope.user.hasBackgroundImage = false;
document.getElementById('mainContentContainer').style.backgroundImage = '';
document.getElementById('mainContentContainer').classList.remove('has-background');
$('#backgroundImageChangeModal').modal('hide');
$scope.backgroundImageChange.reset();
});
$scope.user.hasBackgroundImage = false;
$('#backgroundImageChangeModal').modal('hide');
$scope.backgroundImageChange.reset();
});
},
@@ -278,7 +279,7 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
reset: function () {
$scope.backgroundImageChange.error.avatar = null;
if ($scope.user.hasBackgroundImage) document.getElementById('previewBackgroundImage').src = Client.apiOrigin + '/api/v1/profile/background_image?access_token=' + Client.getToken() + '&bustcache=' + Date.now();
if ($scope.user.hasBackgroundImage) document.getElementById('previewBackgroundImage').src = Client.getBackgroundImageUrl();
else document.getElementById('previewBackgroundImage').src = '/img/background-image-placeholder.svg';
$scope.backgroundImageChange.pictureChanged = false;