Skip to content

Commit

Permalink
Web interface improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ubicorn authored May 11, 2020
1 parent 9f4a6a5 commit 77707ec
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Static/web/ubi.html
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ <h4 class="modal-title">Your KYC proof</h4>
'<div class="tx-output-entries">' +
' <div>' +
' <label for="address">Address:</label>' +
' <input class="address" type="text" class="form-control">' +
' <input class="address form-control" type="text" class="form-control">' +
' </div>' +
' <div class="row"> ' +
' <div class="col-lg-2"><label>Amount:</label></div> ' +
Expand All @@ -1001,7 +1001,7 @@ <h4 class="modal-title">Your KYC proof</h4>
' <div class="col-lg-4"> ' +
' <div class="input-group"> ' +
' <span class="input-group-addon"> ' +
' <select class="currency"><option value="" disabled selected>Currency</option> ' +
' <select class="currency"><option value="0" disabled selected>Currency</option> ' +
' <option value="1">UCH</option> ' +
' <option value="2">UDE</option> ' +
' <option value="3">UAT</option> ' +
Expand Down Expand Up @@ -1157,19 +1157,19 @@ <h4 class="modal-title">Your KYC proof</h4>
var payload = {};

$('#tx-outputs-container').children('.tx-output-entries').each(function( index ) {
console.log($(this).find('.address').val());
console.log($(this).find('.address').val());
payload[$(this).find('.address').val()] = {};
payload[$(this).find('.address').val()][$(this).find('.currency').val()] = {};
payload[$(this).find('.address').val()][$(this).find('.currency').val()] = Math.floor($(this).find('.amount').val() * subUnits);
console.log(payload);
if($(this).find('.address').val().length == 0 || $(this).find('.currency').val() == 0 || $(this).find('.amount').val().length == 0) {
displayError("Address, amout or currency can't be empty");
console.log(payload);
if($(this).find('.address').val().length == 0 || $(this).find('.currency').val() == null || $(this).find('.currency').val() == "" || $(this).find('.currency').val() == "0" || $(this).find('.amount').val().length == 0) {
displayError("Address, amount or currency can't be empty");
NProgress.done();
return;
}
});

console.log(payload);
console.log(payload);

$.ajax( {type: "POST", url:protocol + host + "/wallet/createTransaction", data:{"json": JSON.stringify(payload)}, headers: { 'apiKey': apiKey }} ).done(function(data) {
if(data["success"]) {
Expand Down

0 comments on commit 77707ec

Please sign in to comment.