dashboard: Better state handling for app info notes
This commit is contained in:
@@ -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;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user