Skip to content

Commit 1667076

Browse files
committed
correct diff % padding and fix Op price
1 parent f385477 commit 1667076

File tree

2 files changed

+19
-33
lines changed

2 files changed

+19
-33
lines changed

css/ethplorer.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ a.token-update {
13911391
content: "";
13921392
position: absolute;
13931393
display: block;
1394-
left: 0px;
1394+
left: 0;
13951395
width: 100%;
13961396
height: 60px;
13971397
}
@@ -1420,11 +1420,11 @@ a.token-update {
14201420
}
14211421

14221422
.diff-span {
1423-
padding-right: 10px;
1423+
padding-right: 20px;
14241424
color: rgba(255, 255, 255, 0.6);
14251425
}
14261426
.diff-span span {
1427-
padding-left: 4px;
1427+
padding-left: 6px;
14281428
}
14291429
.diff-zero{
14301430
color: rgba(255, 255, 255, 0.6);

js/ethplorer.js

+16-30
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ Ethplorer = {
351351
}
352352

353353
var valFloat = parseFloat(Ethplorer.Utils.toBig(oOperation.value).toString());
354-
valFloat = valFloat / Math.pow(10, oToken.decimals)
355354
if('undefined' !== typeof(oOperation.formatted)){
356355
if(Ethplorer.Utils.isSafari()){
357356
oOperation.value = valFloat;
@@ -693,7 +692,7 @@ Ethplorer = {
693692
$('.multiop .blue').removeClass('blue');
694693
el.addClass('blue');
695694
el.removeClass('selectable');
696-
Ethplorer.showOpDetails(txData.tx, el[0].operation);
695+
Ethplorer.showOpDetails(oTx, el[0].operation);
697696
}
698697
}else if(multiop){
699698
Ethplorer.showOpDetails(oTx, txData.operations[0]);
@@ -1670,19 +1669,13 @@ Ethplorer = {
16701669
var hint = 'Updated at ' + Ethplorer.Utils.ts2date(rate.ts, true);
16711670

16721671
value = '<span title="' + hint + '">$ ' + Ethplorer.Utils.formatNum(rate.rate, true, 2, true) + '</span><br>';
1673-
if('undefined' !== typeof rate.diff){
1674-
value = value + '<span class="diff-span">24h<span class="' + getDiffClass(rate.diff) + '">'
1675-
+ getDiffString(rate.diff) +'</span></span>'
1676-
}
1677-
if('undefined' !== typeof rate.diff7d){
1678-
value = value + '<span class="diff-span">7d<span class="' + getDiffClass(rate.diff7d) + '">'
1679-
+ getDiffString(rate.diff7d) +'</span></span>'
1680-
}
1681-
if('undefined' !== typeof rate.diff && 'undefined' !== typeof rate.diff7d || 'undefined' !== typeof rate.diff30d){
1682-
var diff30d = rate.diff30d || 123456.789;
1683-
value = value + '<span class="diff-span">30d<span class="' + getDiffClass(diff30d) + '">'
1684-
+ getDiffString(diff30d) +'</span></span>'
1685-
}
1672+
1673+
value = value + '<span class="diff-span">24h<span class="' + getDiffClass(rate.diff) + '">'
1674+
+ getDiffString(rate.diff) +'</span></span>'
1675+
value = value + '<span class="diff-span">7d<span class="' + getDiffClass(rate.diff7d) + '">'
1676+
+ getDiffString(rate.diff7d) +'</span></span>'
1677+
value = value + '<span class="diff-span">30d<span class="' + getDiffClass(rate.diff30d) + '">'
1678+
+ getDiffString(rate.diff30d) +'</span></span>'
16861679
}else{
16871680
value = '';
16881681
}
@@ -1979,10 +1972,10 @@ Ethplorer = {
19791972
var postfix = '';
19801973
if(withPostfix){
19811974
if(!numLimitPostfix) numLimitPostfix = 999999;
1982-
if(num > 999 && num <= numLimitPostfix){
1975+
if(Math.abs(num) > 999 && Math.abs(num) <= numLimitPostfix){
19831976
num = num / 1000;
19841977
postfix = ' K';
1985-
}else if(num > numLimitPostfix){
1978+
} else if(Math.abs(num) > numLimitPostfix){
19861979
num = num / 1000000;
19871980
postfix = ' M';
19881981
}
@@ -2249,21 +2242,14 @@ Ethplorer = {
22492242
initScrollable: function () {
22502243
function checkPosition(el){
22512244
var $el = $(el);
2252-
var $child = $el.children()
2245+
var $child = $el.children();
22532246

2254-
$el
2255-
.removeClass('hide-bottom-gr')
2256-
.removeClass('hide-top-gr');
2247+
$el.removeClass('hide-bottom-gr');
22572248

2258-
console.log($child.outerHeight(true) , $el.outerHeight(true) )
22592249
if ($child.outerHeight(true) < $el.outerHeight(true) || $child.outerHeight(true) - $el.outerHeight(true) + $child.position().top === 0){
22602250
//bottom
22612251
$el.addClass('hide-bottom-gr')
22622252
}
2263-
/*if ($child.position().top === 0){
2264-
//top
2265-
$el.addClass('hide-top-gr')
2266-
}*/
22672253

22682254
}
22692255
$('.scrollwrapper').one("DOMSubtreeModified", function(event){
@@ -2282,17 +2268,17 @@ Ethplorer = {
22822268
};
22832269

22842270
function getDiffClass(value) {
2285-
if (value === 0) {
2271+
if (value === 0 || 'undefined' === typeof value) {
22862272
return 'diff-zero'
22872273
}
22882274
return value > 0 ? 'diff-up' : 'diff-down';
22892275
}
22902276

22912277
function getDiffString(diff){
2292-
if (diff === 0) {
2278+
if ('undefined' === typeof diff) {
22932279
return '--';
22942280
}
2295-
var str = (diff > 0 ? '+' : '');
2296-
str += Ethplorer.Utils.formatNumWidget(diff, true, 2, true, true) + '%';
2281+
var str = ''; //(diff > 0 ? '+' : '');
2282+
str += Ethplorer.Utils.formatNumWidget(diff, true, 2, true, true) + ' %';
22972283
return str;
22982284
}

0 commit comments

Comments
 (0)