Skip to content

Commit

Permalink
CSS updated, JS bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemKo7v committed Dec 15, 2016
1 parent 7bf3298 commit 30b3e8d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 29 deletions.
16 changes: 12 additions & 4 deletions css/ethplorer.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,22 @@ td.list-field {
cursor: pointer;
}

.multiop tr.selectable:hover {
background-color: #ffe87c;
.multiop tr td:nth-child(1) {
max-width: 85px;
}

.multiop tr.selectable:hover td {
color: black !important;
.multiop tr.selectable:hover td span {
text-decoration: underline;
}

a.dashed {
text-decoration: none;
border-bottom: 1px dashed;
}

.multiop a {
color: white !important;
}

.chainy {
display: none;
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="/js/bignumber.js?v=1"></script>
<script src="/js/ethplorer.js?v=1"></script>
<script src="/js/bignumber.js?v=2"></script>
<script src="/js/ethplorer.js?v=2"></script>
<script src="/cfg/config.ethplorer.js"></script>
</head>
<body>
Expand Down Expand Up @@ -61,7 +61,7 @@ <h3 id="error-reason" class="text-danger"></h3>
<div class="col-xs-12 multiop">
<div class="block">
<div class="block-header">
<h3>Transaction operations</h3>
<h3>Internal operations</h3>
</div>
<table class="table">
</table>
Expand Down
48 changes: 26 additions & 22 deletions js/ethplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,28 +226,28 @@ Ethplorer = {

if(txData.operations && txData.operations.length){
txData.operation = txData.operations[txData.operations.length - 1];
if(txData.operations.length > 1){
$('.multiop').show();
for(var i=0; i<txData.operations.length; i++){
var idx = txData.operations.length - i - 1;
var op = txData.operations[idx];
op.index = idx;
var opToken = Ethplorer.prepareToken(op.token);
if('undefined' !== typeof(op.value)){
op.value = Ethplorer.Utils.toBig(op.value).div(Math.pow(10, opToken.decimals));
op.value = Ethplorer.Utils.formatNum(op.value, true, opToken.decimals, true) + ' ' + opToken.symbol;
}
var opParties = '';
if(op.address){
op.to = op.address;
var address = op.address; // Ethplorer.Utils.getEthplorerLink(op.address, op.address, false);
opParties = 'for ' + address;
}else if(op.from && op.to){
var from = op.from; // Ethplorer.Utils.getEthplorerLink(op.from, op.from, false);
var to = op.to; // Ethplorer.Utils.getEthplorerLink(op.to, op.to, false);
opParties = 'from ' + from + '<br class="show_small"> to ' + to;
}
var row = $('<tr data-op-idx="' + idx + '"><td>' + op.type + ' ' + op.value + '<br class="show_small"> ' + opParties + '</td></tr>');
var multiop = txData.operations.length > 1;
for(var i=0; i<txData.operations.length; i++){
var idx = txData.operations.length - i - 1;
var op = txData.operations[idx];
op.index = idx;
var opToken = Ethplorer.prepareToken(op.token);
if('undefined' !== typeof(op.value)){
op.value = Ethplorer.Utils.toBig(op.value).div(Math.pow(10, opToken.decimals));
op.value = Ethplorer.Utils.formatNum(op.value, true, opToken.decimals, true) + ' ' + opToken.symbol;
}
var opParties = '';
if(op.address){
op.to = op.address;
var address = op.address; // Ethplorer.Utils.getEthplorerLink(op.address, op.address, false);
opParties = 'for ' + address;
}else if(op.from && op.to){
var from = op.from; // Ethplorer.Utils.getEthplorerLink(op.from, op.from, false);
var to = op.to; // Ethplorer.Utils.getEthplorerLink(op.to, op.to, false);
opParties = 'from ' + from + '<br class="show_small"> to ' + to;
}
if(multiop){
var row = $('<tr data-op-idx="' + idx + '"><td><a class="dashed">Details</a></td><td><span>' + op.type + '<br class="show_small"> ' + opParties + '</span></td><td class="text-right"><span>' + op.value + '</span></td></tr>');
row.click(function(_tx, _op){
return function(){
if($(this).hasClass('selectable')){
Expand All @@ -262,8 +262,12 @@ Ethplorer = {
}(oTx, op));
$('.multiop table').append(row);
}
}
if(multiop){
$('.multiop table tr').addClass('selectable');
$('.multiop table tr:eq(0)').removeClass('selectable').addClass('blue');
$('.multiop .block-header h3').text(txData.operations.length + ' internal operations found');
$('.multiop').show();
}

var oOperation = txData.operation;
Expand Down

0 comments on commit 30b3e8d

Please sign in to comment.