dashboard: Better state handling for app info notes

This commit is contained in:
Johannes Zellner
2024-06-18 15:49:52 +02:00
parent bd7641f502
commit f15b4a4f4b
2 changed files with 7 additions and 8 deletions
+3 -4
View File
@@ -142,12 +142,12 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
notes: {
busy: true,
busySave: false,
editing: false,
content: '',
placeholder: 'Add admin notes here...',
edit: function () {
$scope.info.notes.busy = false;
$scope.info.notes.content = $scope.app.notes;
$scope.info.notes.editing = true;
@@ -155,13 +155,12 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
},
dismiss: function () {
$scope.info.notes.busy = false;
$scope.info.notes.content = $scope.app.notes;
$scope.info.notes.editing = false;
},
submit: function () {
$scope.info.notes.busy = true;
$scope.info.notes.busySave = true;
Client.configureApp($scope.app.id, 'notes', { notes: $scope.info.notes.content }, function (error) {
if (error) return console.error('Failed to save notes.', error);
@@ -169,8 +168,8 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
refreshApp($scope.app.id, function (error) {
if (error) return Client.error(error);
$scope.info.notes.busySave = false;
$scope.info.notes.editing = false;
$scope.info.notes.busy = false;
});
});
}