Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
fix #768
Browse files Browse the repository at this point in the history
  • Loading branch information
robby-d committed May 15, 2016
1 parent 799a218 commit 19e842a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 15 deletions.
26 changes: 25 additions & 1 deletion src/js/components/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,12 @@ function ExchangeViewModel() {

self.displayAllPairs = function(data) {
for (var i in data) {
data[i].priceRaw = data[i].price;
data[i].volumeRaw = data[i].volume;
data[i].supplyRaw = data[i].supply;
data[i].marketCapRaw = data[i].market_cap;
data[i].progressionRaw = data[i].progression;

data[i].volume = smartFormat(normalizeQuantity(data[i].volume, data[i].quote_divisibility));
data[i].supply = smartFormat(normalizeQuantity(data[i].supply, data[i].base_divisibility));
data[i].market_cap = smartFormat(normalizeQuantity(data[i].market_cap, data[i].quote_divisibility));
Expand All @@ -762,10 +768,28 @@ function ExchangeViewModel() {
}
self.allPairs(data);
if (self.allPairs().length) {
runDataTables('#assetPairMarketInfo', true, {"aaSorting": [[0, 'asc']]});
runDataTables('#assetPairMarketInfo', true,
{
"aaSorting": [[0, 'asc']],
"aoColumns": [
null, // #
null, // market
{"sType": "natural", "iDataSort": 7}, //price
{"sType": "natural", "iDataSort": 8}, //24h volume
{"sType": "natural", "iDataSort": 9}, //supply
{"sType": "natural", "iDataSort": 10}, //market cap
{"sType": "natural", "iDataSort": 11}, //24h change
{"bVisible": false}, //price RAW
{"bVisible": false}, //24h volume RAW
{"bVisible": false}, //supply RAW
{"bVisible": false}, //market cap RAW
{"bVisible": false} //24h change RAW
]
});
}
}


self.fetchAllPairs = function() {
try {
self.allPairs([]);
Expand Down
1 change: 1 addition & 0 deletions src/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,4 @@ function getAddressLabel(address) {
//gets the address label if the address is in this wallet
return PREFERENCES['address_aliases'][hashToB64(address)] || address;
}

24 changes: 11 additions & 13 deletions src/pages/exchange.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,18 @@ <h3 data-bind="locale: 'all_pairs'"></h3>
<tbody data-bind="foreach: allPairs">
<tr data-bind="click: $parent.selectMarket">
<td class="number" data-bind="text: pos"></td>
<td style="with-space:nowrap">
<b><span data-bind="text: base_asset"></span></b> / <span data-bind="text: quote_asset"></span>
</td>
<td style="text-align:right" data-bind="attr: {class: price_class}">
<span data-bind="text: price"></span>
<span data-bind="text: quote_asset"></span>
</td>
<td class="number">
<span data-bind="text: volume || '0'"></span>
<span data-bind="text: quote_asset"></span>
</td>
<td style="with-space:nowrap" data-bind="text: base_asset + ' / ' + quote_asset"></td>
<td style="text-align:right" data-bind="text: price + ' ' + quote_asset, attr: {class: price_class}"></td>
<td class="number" data-bind="text: (volume || '0') + ' ' + quote_asset"></td>
<td class="number" data-bind="text: supply + ' ' + base_asset"></td>
<td class="number" data-bind="text: market_cap + ' ' + quote_asset"></td>
<td class="number" data-bind="text: (market_cap || '0') + ' ' + quote_asset"></td>
<td style="text-align:center" data-bind="text: progression, attr: {class: prog_class}"></td>

<td data-bind="text: priceRaw" class="display-none"></td>
<td data-bind="text: volumeRaw" class="display-none"></td>
<td data-bind="text: supplyRaw" class="display-none"></td>
<td data-bind="text: marketCapRaw" class="display-none"></td>
<td data-bind="text: progressionRaw" class="display-none"></td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -604,4 +602,4 @@ <h3 data-bind="locale: 'completed_trades_for', localeArgs: dispAssetPair"></h3>
</div> <!-- end widget -->
</article> <!-- WIDGET END -->
</div> <!-- end row -->
</section>
</section>
2 changes: 1 addition & 1 deletion src/pages/leaderboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ <h3><span data-bind="locale: 'leader_board_in', localeArgs: base"></span></h3>
<td data-bind="text: volume"></td>
<td data-bind="text: pctChange, class: pctChangeColorClass"></td>
<td class="leaderboardMiniChart" data-bind="attr: { id: 'miniChart-' + $parent.base + '-' + asset }"></td>

<td data-bind="text: marketCapRaw" class="display-none"></td>
<td data-bind="text: priceRaw" class="display-none"></td>
<td data-bind="text: supplyRaw" class="display-none"></td>
Expand Down

0 comments on commit 19e842a

Please sign in to comment.