From 8577443bd0b1d44963d400c16dc20ff50f31ec4c Mon Sep 17 00:00:00 2001 From: Satinder Grewal Date: Wed, 31 Aug 2016 22:58:41 +1200 Subject: [PATCH] updated progress bar code --- assets/scripts/dashboard.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/assets/scripts/dashboard.js b/assets/scripts/dashboard.js index ccff0e9..54ec504 100644 --- a/assets/scripts/dashboard.js +++ b/assets/scripts/dashboard.js @@ -198,11 +198,10 @@ var Dashboard = function() { } else { //ShowCoinHistory(historyvalues); /*console.log('wallet widget refereshed (every 1 seconds)');*/ + //Show Coin Progress Bars + ShowCoinProgressBar(AllcoinsDataOutput[value][index]); } }, 1000); - - //Show Coin Progress Bars - ShowCoinProgressBar(AllcoinsDataOutput[value][index]); }); }, @@ -537,7 +536,7 @@ function ShowCoinProgressBar(coin) { console.log('== Coin Info Data OutPut =='); console.log(CoinInfoData.bundles); - if ( parseFloat(CoinInfoData.bundles) < 99 ) { + if ( parseFloat(CoinInfoData.bundles) < 99 || parseFloat(CoinInfoData.utxo) < 99 || parseFloat(CoinInfoData.balances) < 99 || parseFloat(CoinInfoData.validated) < 99 ) { console.log(coin+' is less than 99% complete.'); $('div[data-currency="'+coin+'"][id="currency-progressbars"]').show(); $('div[data-currency="'+coin+'"][id="currency-bundles"]').width(parseFloat(CoinInfoData.bundles).toFixed(2)+'%'); @@ -549,6 +548,9 @@ function ShowCoinProgressBar(coin) { $('div[data-currency="'+coin+'"][id="currency-validated"]').width(parseFloat(CoinInfoData.validated).toFixed(2)+'%'); $('span[data-currency="'+coin+'"][id="currency-validated-percent"]').text(parseFloat(CoinInfoData.validated).toFixed(2)+'%'); } + if ( parseFloat(CoinInfoData.bundles) > 99 || parseFloat(CoinInfoData.utxo) > 99 || parseFloat(CoinInfoData.balances) > 99 || parseFloat(CoinInfoData.validated) > 99 ) { + $('div[data-currency="'+coin+'"][id="currency-progressbars"]').hide(); + } }, error: function(xhr, textStatus, error) { console.log('failed getting Coin History.');