diff options
author | Florian Dold <florian.dold@gmail.com> | 2015-12-17 13:30:34 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2015-12-17 13:30:34 +0100 |
commit | b93638b6935e7fb179385cd38a1691372b4c8432 (patch) | |
tree | e36ab895ff4a39599d626cf0ff70e965f68ae9b2 /extension/popup/balance-overview.js | |
parent | c3a9888dfe308e063fc9edaebcc834d8d1896224 (diff) | |
download | wallet-core-b93638b6935e7fb179385cd38a1691372b4c8432.tar.xz |
Add types, simplify balance display.
Diffstat (limited to 'extension/popup/balance-overview.js')
-rw-r--r-- | extension/popup/balance-overview.js | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/extension/popup/balance-overview.js b/extension/popup/balance-overview.js index f33be0637..4fd991b23 100644 --- a/extension/popup/balance-overview.js +++ b/extension/popup/balance-overview.js @@ -17,31 +17,9 @@ let React = { document.addEventListener('DOMContentLoaded', (e) => { console.log("content loaded"); chrome.runtime.sendMessage({ type: "balances" }, function (wallet) { - console.log("got balance"); - let n = 0; - let table = React.createElement("div", null); - let source = document.getElementById("balance-template").innerHTML; - console.log("size", Object.keys(wallet).length); - if (Object.keys(wallet).length > 0) { - let template = Handlebars.compile(source); - console.log("wallet ", JSON.stringify(wallet)); - let html = template(wallet); - console.log("Hb generated html", html); - table.innerHTML = html; - let p = document.getElementById("content"); - p.replaceChild(table, p.firstElementChild); - } - /* - for (let curr in wallet) { - n++; - let x = wallet[curr]; - let num = x.value + x.fraction / 10e6; - table.appendChild(<p>{num} <a>{x.currency}</a></p>); - } - if (n != 0) { - let p = document.getElementById("content"); - p.replaceChild(table, p.firstElementChild); - } */ + let context = document.getElementById("balance-template").innerHTML; + let template = Handlebars.compile(context); + document.getElementById("content").innerHTML = template(wallet); }); document.getElementById("debug").addEventListener("click", (e) => { chrome.tabs.create({ |