prelim remake of tx detail view

This commit is contained in:
Marty Alcala 2016-10-21 16:56:19 -04:00
commit 298956f97f
5 changed files with 139 additions and 9 deletions

View file

@ -1,14 +1,21 @@
'use strict';
angular.module('copayApp.controllers').controller('txDetailsController', function($log, $timeout, $scope, $filter, $stateParams, ongoingProcess, walletService, lodash, gettextCatalog, profileService, configService, txFormatService, externalLinkService, popupService) {
console.log('in txDetailsController');
var config = configService.getSync();
var configWallet = config.wallet;
var walletSettings = configWallet.settings;
var wallet;
$scope.title = gettextCatalog.getString('Transaction');
console.log('$stateParams', $stateParams);
$scope.btx = $stateParams.tx;
$scope.wallet = $stateParams.wallet;
$scope.init = function() {
console.log('init called');
wallet = $scope.wallet;
console.log('wallet', wallet);
$scope.alternativeIsoCode = walletSettings.alternativeIsoCode;
$scope.color = wallet.color;
$scope.copayerId = wallet.credentials.copayerId;
@ -149,4 +156,6 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
$scope.cancel = function() {
$scope.txDetailsModal.hide();
};
$scope.init();
});

View file

@ -68,7 +68,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
$scope.wallet = wallet;
$scope.btx = lodash.cloneDeep(tx);
$ionicModal.fromTemplateUrl('views/modals/tx-details.html', {
$ionicModal.fromTemplateUrl('views/confirm.html', {
scope: $scope
}).then(function(modal) {
$scope.txDetailsModal = modal;

View file

@ -92,12 +92,15 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
$scope.openTxModal = function(btx) {
$scope.btx = lodash.cloneDeep(btx);
$scope.walletId = $scope.wallet.id;
$ionicModal.fromTemplateUrl('views/modals/tx-details.html', {
scope: $scope
}).then(function(modal) {
$scope.txDetailsModal = modal;
$scope.txDetailsModal.show();
});
console.log('$state.go called');
$state.go('tabs.wallet.tx-details', {tx: $scope.btx, wallet: $scope.wallet});
// $ionicModal.fromTemplateUrl('views/modals/tx-details.html', {
// scope: $scope
// }).then(function(modal) {
// $scope.txDetailsModal = modal;
// $scope.txDetailsModal.show();
// });
};
$scope.recreate = function() {

View file

@ -177,6 +177,19 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
}
})
.state('tabs.wallet.tx-details', {
url: '/:id',
views: {
'tab-home@tabs': {
controller: 'txDetailsController',
templateUrl: 'views/modals/tx-details.html'
}
},
params: {
tx: null,
wallet: null
}
})
/*
*