spinner on submit button via http://jsfiddle.net/xc6nx235/16/
This commit is contained in:
@@ -146,21 +146,28 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
||||
});
|
||||
}
|
||||
|
||||
$scope.postTransaction = function() {
|
||||
var newTransaction = new Transaction({
|
||||
"account" : $scope.account._links.self.href,
|
||||
"amount" : amountToNumber($scope.transaction.amount),
|
||||
"date" : $scope.transaction.date,
|
||||
"description" : $scope.transaction.description,
|
||||
"category" : $scope.transaction.category._links.self.href,
|
||||
"creditor" : $scope.transaction.creditor
|
||||
});
|
||||
|
||||
newTransaction.$save(function(transaction) {
|
||||
$scope.refreshList();
|
||||
$scope.lastSubmission = newTransaction;
|
||||
});
|
||||
};
|
||||
$scope.submitTransaction = function() {
|
||||
if (document.getElementById('amountInput').value) {
|
||||
document.getElementById('transactionSubmit').disabled = true;
|
||||
$scope.waitingForSubmission = true;
|
||||
|
||||
var newTransaction = new Transaction({
|
||||
"account" : $scope.account._links.self.href,
|
||||
"amount" : amountToNumber($scope.transaction.amount),
|
||||
"date" : $scope.transaction.date,
|
||||
"description" : $scope.transaction.description,
|
||||
"category" : $scope.transaction.category._links.self.href,
|
||||
"creditor" : $scope.transaction.creditor
|
||||
});
|
||||
|
||||
newTransaction.$save(function(transaction) {
|
||||
document.getElementById('transactionSubmit').disabled = false;
|
||||
$scope.waitingForSubmission = false;
|
||||
$scope.refreshList();
|
||||
$scope.lastSubmission = newTransaction;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$scope.deleteLastSubmission = function() {
|
||||
var testTrns = $resource($scope.lastSubmission._links.self.href).delete(function() {
|
||||
|
||||
Reference in New Issue
Block a user