more portfolio updates

This commit is contained in:
Nathan Parikh 2017-09-13 10:03:34 -05:00
parent 6da0f8f5bd
commit 0f1b2b3d86
3 changed files with 7 additions and 1 deletions

View File

@ -325,6 +325,7 @@ ul {
} }
#portfolioChart { #portfolioChart {
max-height: 480px; max-height: 480px;
max-width: 100%;
} }
/*Scrollbar*/ /*Scrollbar*/

View File

@ -169,9 +169,11 @@ function initData() {
ul = document.getElementById("prices"); ul = document.getElementById("prices");
ulPortfolio = document.getElementById("portfolio-list"); ulPortfolio = document.getElementById("portfolio-list");
li = ul.getElementsByTagName('li'); li = ul.getElementsByTagName('li');
liPortfolio = ulPortfolio.getElementsByTagName('li');
// Loop through all list items // Loop through all list items
for (i = 0; i < li.length; i++) { for (i = 0; i < li.length; i++) {
li[i].setAttribute("sortorder", i); li[i].setAttribute("sortorder", i);
var elementID = li[i].id; var elementID = li[i].id;
//alert(elementID); //alert(elementID);
settings.set(elementID, { // coin-BTC settings.set(elementID, { // coin-BTC
@ -350,6 +352,8 @@ function updateData() {
}, },
options: { options: {
animation : false, animation : false,
responsive: false,
maintainAspectRatio: true,
legend : { legend : {
position: 'bottom' position: 'bottom'
} }
@ -404,6 +408,7 @@ for (let key of Object.keys(portfolio_list)) {
} }
else { else {
inputValue = '0'; inputValue = '0';
inputValue = settings.set('quantity.'+[coin], '0');
} }
span.innerHTML = '<span class="sym">' + coin + '</span> <span class="block quantity"><label for="quantity.' + coin +'">Quantity</label> <input type="number" name="quantity.' + coin +'" min="0" value="'+inputValue+'" step=".01"></span> <span class="block value"><label>Current Value</label><span class="quantity-value"></span></span>'; span.innerHTML = '<span class="sym">' + coin + '</span> <span class="block quantity"><label for="quantity.' + coin +'">Quantity</label> <input type="number" name="quantity.' + coin +'" min="0" value="'+inputValue+'" step=".01"></span> <span class="block value"><label>Current Value</label><span class="quantity-value"></span></span>';

View File

@ -1,7 +1,7 @@
{ {
"name": "crypto-price-widget", "name": "crypto-price-widget",
"productName": "Crypto Price Widget", "productName": "Crypto Price Widget",
"version": "1.0.0", "version": "1.0.1",
"description": "A cross-platform app for tracking Crypto prices", "description": "A cross-platform app for tracking Crypto prices",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {