Skip to content

Commit bf320e4

Browse files
committed
Hide filter for big lists.
1 parent a486fe3 commit bf320e4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/ethplorer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Ethplorer = {
5858
}
5959
}
6060
}
61+
Ethplorer.maxListSize = 0;
6162
Ethplorer.showTx = Ethplorer.Storage.get('showTx', 'all');
6263
var showTxHash = window.location.hash.substr(1);
6364
if(showTxHash){
@@ -956,6 +957,7 @@ Ethplorer = {
956957

957958
if(data.pager && data.pager.transfers){
958959
data.token.transfersCount = data.pager.transfers.total;
960+
if(data.token.transfersCount > Ethplorer.maxListSize) Ethplorer.maxListSize = data.token.transfersCount;
959961
}
960962
if(data.pager && data.pager.issuances){
961963
data.token.issuancesCount = '';
@@ -969,6 +971,7 @@ Ethplorer = {
969971

970972
if(data.contract && data.contract.txsCount && (data.contract.txsCount > data.token.txsCount)){
971973
data.token.txsCount = data.contract.txsCount;
974+
if(data.token.txsCount > Ethplorer.maxListSize) Ethplorer.maxListSize = data.token.txsCount;
972975
}
973976

974977
var fields = [
@@ -1147,7 +1150,7 @@ Ethplorer = {
11471150
showFilter: function(data){
11481151
var activeTab = Ethplorer.getActiveTab();
11491152
if(activeTab && data.pager && data.pager[activeTab]){
1150-
if(data.pager[activeTab].records > 100000 || ((activeTab == 'transfers') && (data.token && data.token.txsCount && data.token.txsCount > 100000))){
1153+
if(data.pager[activeTab].records > 100000 || Ethplorer.maxListSize > 100000){
11511154
$('#filter_list').hide();
11521155
}else{
11531156
if(Ethplorer.showTx && data.token){
@@ -1340,6 +1343,7 @@ Ethplorer = {
13401343
if(data.pager && data.pager.transfers){
13411344
var pagination = $('<tr class="paginationFooter"><td colspan="10"></td></tr>');
13421345
Ethplorer.drawPager(pagination.find('td'), data.pager.transfers);
1346+
if(data.pager.transfers.total && (data.pager.transfers.total > Ethplorer.maxListSize)) Ethplorer.maxListSize = data.pager.transfers.total;
13431347
$('#' + tableId + ' .table').append(pagination);
13441348
}
13451349
}

0 commit comments

Comments
 (0)