Skip to content

Commit ccc66bf

Browse files
committed
Multiple operations table layout
1 parent 30b3e8d commit ccc66bf

File tree

2 files changed

+62
-6
lines changed

2 files changed

+62
-6
lines changed

css/ethplorer.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,31 @@ td.list-field {
210210
max-width: 85px;
211211
}
212212

213+
.multiop tr td:nth-child(2) {
214+
max-width: 50vw;
215+
overflow: hidden;
216+
text-overflow: ellipsis;
217+
}
218+
219+
.multiop tr td:nth-child(2),
220+
.multiop tr td:nth-child(3),
221+
.multiop tr td:nth-child(4)
222+
{
223+
min-width: 65px;
224+
}
225+
226+
.multiop tr td:nth-child(4) {
227+
max-width: 65px;
228+
overflow: hidden;
229+
text-overflow: ellipsis;
230+
white-space: nowrap;
231+
}
232+
233+
.multiop tr td:nth-child(5){
234+
display: none;
235+
max-width: 4px;
236+
}
237+
213238
.multiop tr.selectable:hover td span {
214239
text-decoration: underline;
215240
}
@@ -310,6 +335,10 @@ small {
310335
animation: hrhand 8s linear infinite;
311336
}
312337

338+
.cuttable-address {
339+
white-space: nowrap;
340+
}
341+
313342
@media screen and (max-width: 640px) {
314343
.footer {
315344
line-height: 12px;
@@ -403,6 +432,15 @@ small {
403432
}
404433

405434
@media screen and (max-width: 767px) {
435+
436+
.multiop tr td:nth-child(3),
437+
.multiop tr td:nth-child(4)
438+
{
439+
display: none;
440+
}
441+
.multiop tr td:nth-child(5){
442+
display: table-cell;
443+
}
406444

407445
#address-token-transfers .block {
408446
max-width: 100vw;

js/ethplorer.js

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,28 +234,46 @@ Ethplorer = {
234234
var opToken = Ethplorer.prepareToken(op.token);
235235
if('undefined' !== typeof(op.value)){
236236
op.value = Ethplorer.Utils.toBig(op.value).div(Math.pow(10, opToken.decimals));
237-
op.value = Ethplorer.Utils.formatNum(op.value, true, opToken.decimals, true) + ' ' + opToken.symbol;
237+
op.value = Ethplorer.Utils.formatNum(op.value, true, opToken.decimals, true);
238+
op.symbol = opToken.symbol;
238239
}
239240
var opParties = '';
240241
if(op.address){
241242
op.to = op.address;
242243
var address = op.address; // Ethplorer.Utils.getEthplorerLink(op.address, op.address, false);
243244
opParties = 'for ' + address;
244245
}else if(op.from && op.to){
245-
var from = op.from; // Ethplorer.Utils.getEthplorerLink(op.from, op.from, false);
246-
var to = op.to; // Ethplorer.Utils.getEthplorerLink(op.to, op.to, false);
247-
opParties = 'from ' + from + '<br class="show_small"> to ' + to;
246+
var from = '<span class="cuttable-address">from ' + op.from + '</span>';
247+
var to = '<span class="cuttable-address">to ' + op.to + '</span>';
248+
opParties = from + '<br class="show_small"> ' + to;
248249
}
249250
if(multiop){
250-
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>');
251+
var row = $(
252+
'<tr data-op-idx="' + idx + '">' +
253+
'<td><a class="dashed">Details</a></td>' +
254+
'<td><span>' + op.type +
255+
'<span class="show_small"> ' + op.value + ' ' + op.symbol + '</span>' +
256+
'<br class="show_small"> ' + opParties + '</span></td>' +
257+
'<td class="text-right"><span>' + op.value + '</span></td>' +
258+
'<td><span>' + op.symbol + '</span></td>' +
259+
'<td></td>' +
260+
'</tr>'
261+
);
251262
row.click(function(_tx, _op){
252263
return function(){
253264
if($(this).hasClass('selectable')){
254265
$(this).removeClass('selectable');
255266
$('.multiop .blue').addClass('selectable');
256267
$('.multiop .blue').removeClass('blue');
257268
$(this).addClass('blue');
258-
Ethplorer.showOpDetails(_tx, _op);
269+
$('.token-related').animate({opacity:0.1}, 250, function(){
270+
$('.token-related').animate({opacity:1}, 250);
271+
});
272+
setTimeout(function(__tx, __op){
273+
return function(){
274+
Ethplorer.showOpDetails(__tx, __op);
275+
};
276+
}(_tx, _op), 250);
259277
document.location.hash = _op.index;
260278
}
261279
};

0 commit comments

Comments
 (0)