@@ -351,7 +351,6 @@ Ethplorer = {
351
351
}
352
352
353
353
var valFloat = parseFloat ( Ethplorer . Utils . toBig ( oOperation . value ) . toString ( ) ) ;
354
- valFloat = valFloat / Math . pow ( 10 , oToken . decimals )
355
354
if ( 'undefined' !== typeof ( oOperation . formatted ) ) {
356
355
if ( Ethplorer . Utils . isSafari ( ) ) {
357
356
oOperation . value = valFloat ;
@@ -693,7 +692,7 @@ Ethplorer = {
693
692
$ ( '.multiop .blue' ) . removeClass ( 'blue' ) ;
694
693
el . addClass ( 'blue' ) ;
695
694
el . removeClass ( 'selectable' ) ;
696
- Ethplorer . showOpDetails ( txData . tx , el [ 0 ] . operation ) ;
695
+ Ethplorer . showOpDetails ( oTx , el [ 0 ] . operation ) ;
697
696
}
698
697
} else if ( multiop ) {
699
698
Ethplorer . showOpDetails ( oTx , txData . operations [ 0 ] ) ;
@@ -1670,19 +1669,13 @@ Ethplorer = {
1670
1669
var hint = 'Updated at ' + Ethplorer . Utils . ts2date ( rate . ts , true ) ;
1671
1670
1672
1671
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>'
1686
1679
} else {
1687
1680
value = '' ;
1688
1681
}
@@ -1979,10 +1972,10 @@ Ethplorer = {
1979
1972
var postfix = '' ;
1980
1973
if ( withPostfix ) {
1981
1974
if ( ! numLimitPostfix ) numLimitPostfix = 999999 ;
1982
- if ( num > 999 && num <= numLimitPostfix ) {
1975
+ if ( Math . abs ( num ) > 999 && Math . abs ( num ) <= numLimitPostfix ) {
1983
1976
num = num / 1000 ;
1984
1977
postfix = ' K' ;
1985
- } else if ( num > numLimitPostfix ) {
1978
+ } else if ( Math . abs ( num ) > numLimitPostfix ) {
1986
1979
num = num / 1000000 ;
1987
1980
postfix = ' M' ;
1988
1981
}
@@ -2249,21 +2242,14 @@ Ethplorer = {
2249
2242
initScrollable : function ( ) {
2250
2243
function checkPosition ( el ) {
2251
2244
var $el = $ ( el ) ;
2252
- var $child = $el . children ( )
2245
+ var $child = $el . children ( ) ;
2253
2246
2254
- $el
2255
- . removeClass ( 'hide-bottom-gr' )
2256
- . removeClass ( 'hide-top-gr' ) ;
2247
+ $el . removeClass ( 'hide-bottom-gr' ) ;
2257
2248
2258
- console . log ( $child . outerHeight ( true ) , $el . outerHeight ( true ) )
2259
2249
if ( $child . outerHeight ( true ) < $el . outerHeight ( true ) || $child . outerHeight ( true ) - $el . outerHeight ( true ) + $child . position ( ) . top === 0 ) {
2260
2250
//bottom
2261
2251
$el . addClass ( 'hide-bottom-gr' )
2262
2252
}
2263
- /*if ($child.position().top === 0){
2264
- //top
2265
- $el.addClass('hide-top-gr')
2266
- }*/
2267
2253
2268
2254
}
2269
2255
$ ( '.scrollwrapper' ) . one ( "DOMSubtreeModified" , function ( event ) {
@@ -2282,17 +2268,17 @@ Ethplorer = {
2282
2268
} ;
2283
2269
2284
2270
function getDiffClass ( value ) {
2285
- if ( value === 0 ) {
2271
+ if ( value === 0 || 'undefined' === typeof value ) {
2286
2272
return 'diff-zero'
2287
2273
}
2288
2274
return value > 0 ? 'diff-up' : 'diff-down' ;
2289
2275
}
2290
2276
2291
2277
function getDiffString ( diff ) {
2292
- if ( diff === 0 ) {
2278
+ if ( 'undefined' === typeof diff ) {
2293
2279
return '--' ;
2294
2280
}
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 ) + ' %' ;
2297
2283
return str ;
2298
2284
}
0 commit comments