modal instead of partial for transaction details
This commit is contained in:
@@ -201,10 +201,6 @@ transactionControllers.controller('TransactionListCtrl', [ '$http', '$scope', '$
|
||||
});
|
||||
};
|
||||
|
||||
$scope.showTransaction = function(transaction) {
|
||||
$location.path('/transaction/' + transaction._links.self.href);
|
||||
};
|
||||
|
||||
$scope.moreTransactions = function() {
|
||||
if ($scope.nextPageAvailable) {
|
||||
$scope.pageNumber++;
|
||||
@@ -229,20 +225,16 @@ transactionControllers.controller('TransactionListCtrl', [ '$http', '$scope', '$
|
||||
});
|
||||
};
|
||||
|
||||
$scope.items = ['item1', 'item2', 'item3'];
|
||||
|
||||
$scope.openDetails = function() {
|
||||
$scope.openDetails = function(transaction) {
|
||||
var modalInstance = $uibModal.open({
|
||||
templateUrl: 'detailsTemplate.html',
|
||||
controller: 'DetailsModalCtrl',
|
||||
resolve: {
|
||||
items: function () {
|
||||
return $scope.items;
|
||||
}
|
||||
transaction: transaction
|
||||
}
|
||||
});
|
||||
|
||||
modalInstance.result.then(function (selectedItem) {
|
||||
modalInstance.result.then(function(selectedItem) {
|
||||
$scope.selected = selectedItem;
|
||||
}, function () {
|
||||
$log.info('Modal dismissed at: ' + new Date());
|
||||
@@ -254,12 +246,9 @@ transactionControllers.controller('TransactionListCtrl', [ '$http', '$scope', '$
|
||||
|
||||
} ]);
|
||||
|
||||
transactionControllers.controller('DetailsModalCtrl', [ '$scope', '$uibModalInstance', 'items', function($scope, $uibModalInstance, items) {
|
||||
transactionControllers.controller('DetailsModalCtrl', [ '$scope', '$uibModalInstance', 'transaction', function($scope, $uibModalInstance, transaction) {
|
||||
|
||||
$scope.items = items;
|
||||
$scope.selected = {
|
||||
item: $scope.items[0]
|
||||
};
|
||||
$scope.transaction = transaction;
|
||||
|
||||
$scope.ok = function () {
|
||||
$uibModalInstance.close($scope.selected.item);
|
||||
@@ -272,7 +261,7 @@ transactionControllers.controller('DetailsModalCtrl', [ '$scope', '$uibModalInst
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO to be removed
|
||||
transactionControllers.controller('TransactionDetailCtrl', [ '$scope', '$routeParams', '$resource', '$location', function($scope, $routeParams, $resource, $location) {
|
||||
|
||||
$scope.initDetails = function() {
|
||||
|
||||
Reference in New Issue
Block a user