Skip to content

Commit d7988d0

Browse files
Merge pull request byteball#261 from kakysha/master
fixes
2 parents a4ce3ea + a7f26f8 commit d7988d0

File tree

2 files changed

+72
-58
lines changed

2 files changed

+72
-58
lines changed

public/views/walletHome.html

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
.mtab-title.active {
2020
color: #34495E;
2121
}
22+
.hor-link {
23+
max-width: 45%;
24+
display: inline-block;
25+
padding: 0 30px;
26+
line-height: 1em;
27+
}
28+
.hor-link:nth-child(1) {
29+
border-right: 1px solid #E9E9EC;
30+
}
2231
</style>
2332

2433

@@ -282,16 +291,18 @@ <h4 ng-class="{'enable_text_select': !index.isCordova}" class="size-12">
282291
</button>
283292
</div>
284293
</div>
285-
<div class="m20t text-center m30b" ng-show="!home.generatingAddress && home.addr[index.walletId]">
286-
<a class="size-14" ng-click="home.openCustomizedAmountModal(index.shared_address || home.addr[index.walletId])" ng-style="{'color':index.backgroundColor}">
287-
<span translate>Request a specific amount</span>
288-
</a>
289-
</div>
290-
<div class="m20t text-center m30b" ng-show="!home.generatingAddress && home.addr[index.walletId]">
291-
<a class="size-14" ng-click="home.openClaimTextcoinModal(home.addr[index.walletId])" ng-style="{'color':index.backgroundColor}">
292-
<span translate>Claim funds using mnemonic</span>
293-
</a>
294-
</div>
294+
<div class="m20t text-center m30b">
295+
<div class="text-center hor-link" ng-show="!home.generatingAddress && home.addr[index.walletId]">
296+
<a class="size-14" ng-click="home.openCustomizedAmountModal(index.shared_address || home.addr[index.walletId])" ng-style="{'color':index.backgroundColor}">
297+
<span translate>Request a specific amount</span>
298+
</a>
299+
</div>
300+
<div class="text-center hor-link" ng-show="!home.generatingAddress && home.addr[index.walletId]">
301+
<a class="size-14" ng-click="home.openClaimTextcoinModal(home.addr[index.walletId])" ng-style="{'color':index.backgroundColor}">
302+
<span translate>Claim funds using textcoin</span>
303+
</a>
304+
</div>
305+
</div>
295306
</div>
296307
</div> <!-- END Receive -->
297308

src/js/controllers/walletHome.js

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,7 @@ angular.module('copayApp.controllers')
10651065
$scope.index.assetIndex = $scope.assetIndexSelectorValue;
10661066
this.shownForm = 'payment';
10671067
}
1068+
$scope.mtab = 1;
10681069
}
10691070

10701071
this.submitData = function() {
@@ -1308,58 +1309,60 @@ angular.module('copayApp.controllers')
13081309

13091310
this.setForm = function(to, amount, comment, asset, recipient_device_address) {
13101311
this.resetError();
1311-
delete this.binding;
1312-
var form = $scope.sendPaymentForm;
1313-
if (!form || !form.address) // disappeared?
1314-
return console.log('form.address has disappeared');
1315-
if (to) {
1316-
form.address.$setViewValue(to);
1317-
form.address.$isValid = true;
1318-
form.address.$render();
1319-
this.lockAddress = true;
1320-
if (recipient_device_address) // must be already paired
1321-
assocDeviceAddressesByPaymentAddress[to] = recipient_device_address;
1322-
}
1312+
$timeout((function() {
1313+
delete this.binding;
1314+
var form = $scope.sendPaymentForm;
1315+
if (!form || !form.address) // disappeared?
1316+
return console.log('form.address has disappeared');
1317+
if (to) {
1318+
form.address.$setViewValue(to);
1319+
form.address.$isValid = true;
1320+
form.address.$render();
1321+
this.lockAddress = true;
1322+
if (recipient_device_address) // must be already paired
1323+
assocDeviceAddressesByPaymentAddress[to] = recipient_device_address;
1324+
}
13231325

1324-
if (amount) {
1325-
// form.amount.$setViewValue("" + amount);
1326-
// form.amount.$isValid = true;
1327-
this.lockAmount = true;
1328-
$timeout(function() {
1329-
form.amount.$setViewValue("" + profileService.getAmountInDisplayUnits(amount, asset));
1330-
form.amount.$isValid = true;
1326+
if (amount) {
1327+
// form.amount.$setViewValue("" + amount);
1328+
// form.amount.$isValid = true;
1329+
this.lockAmount = true;
1330+
$timeout(function() {
1331+
form.amount.$setViewValue("" + profileService.getAmountInDisplayUnits(amount, asset));
1332+
form.amount.$isValid = true;
1333+
form.amount.$render();
1334+
});
1335+
}
1336+
else {
1337+
this.lockAmount = false;
1338+
form.amount.$pristine = true;
1339+
form.amount.$setViewValue('');
13311340
form.amount.$render();
1332-
});
1333-
}
1334-
else {
1335-
this.lockAmount = false;
1336-
form.amount.$pristine = true;
1337-
form.amount.$setViewValue('');
1338-
form.amount.$render();
1339-
}
1340-
// form.amount.$render();
1341+
}
1342+
// form.amount.$render();
13411343

1342-
if (form.merkle_proof) {
1343-
form.merkle_proof.$setViewValue('');
1344-
form.merkle_proof.$render();
1345-
}
1346-
if (comment) {
1347-
form.comment.$setViewValue(comment);
1348-
form.comment.$isValid = true;
1349-
form.comment.$render();
1350-
}
1344+
if (form.merkle_proof) {
1345+
form.merkle_proof.$setViewValue('');
1346+
form.merkle_proof.$render();
1347+
}
1348+
if (comment) {
1349+
form.comment.$setViewValue(comment);
1350+
form.comment.$isValid = true;
1351+
form.comment.$render();
1352+
}
13511353

1352-
if (asset) {
1353-
var assetIndex = lodash.findIndex($scope.index.arrBalances, {
1354-
asset: asset
1355-
});
1356-
if (assetIndex < 0)
1357-
throw Error("failed to find asset index of asset " + asset);
1358-
$scope.index.assetIndex = assetIndex;
1359-
this.lockAsset = true;
1360-
}
1361-
else
1362-
this.lockAsset = false;
1354+
if (asset) {
1355+
var assetIndex = lodash.findIndex($scope.index.arrBalances, {
1356+
asset: asset
1357+
});
1358+
if (assetIndex < 0)
1359+
throw Error("failed to find asset index of asset " + asset);
1360+
$scope.index.assetIndex = assetIndex;
1361+
this.lockAsset = true;
1362+
}
1363+
else
1364+
this.lockAsset = false;
1365+
}).bind(this), 1);
13631366
};
13641367

13651368
this.resetForm = function() {

0 commit comments

Comments
 (0)