Add per-app notes feature
This commit is contained in:
@@ -136,6 +136,43 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
}
|
||||
};
|
||||
|
||||
$scope.info = {
|
||||
notes: {
|
||||
busy: false,
|
||||
editing: false,
|
||||
content: '',
|
||||
|
||||
edit: function () {
|
||||
$scope.info.notes.busy = false;
|
||||
$scope.info.notes.content = $scope.app.notes;
|
||||
$scope.info.notes.editing = true;
|
||||
},
|
||||
|
||||
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;
|
||||
|
||||
Client.configureApp($scope.app.id, 'notes', { notes: $scope.info.notes.content }, function (error) {
|
||||
if (error) return console.error('Failed to save notes.', error);
|
||||
|
||||
$scope.info.notes.busy = false;
|
||||
$scope.info.notes.editing = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
show: function () {
|
||||
$scope.info.notes.busy = false;
|
||||
$scope.info.notes.content = $scope.app.notes;
|
||||
$scope.info.notes.editing = false;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.display = {
|
||||
busy: false,
|
||||
error: {},
|
||||
|
||||
Reference in New Issue
Block a user