dynamic html title depending on selected currency

This commit is contained in:
Michael Muré 2014-05-08 10:27:51 +02:00
parent 49f1f54869
commit 67c6aedc1c
2 changed files with 8 additions and 2 deletions

View file

@ -6658,9 +6658,12 @@ janin.currency = {
useCurrency: function(index) {
janin.selectedCurrency = janin.currencies[index];
var coinImgUrl = "logos/" + janin.selectedCurrency.name.toLowerCase() + ".png";
var coinImgUrl = "logos/" + janin.currency.name().toLowerCase() + ".png";
document.getElementById("coinLogoImg").src = coinImgUrl;
// Update title depending on currency
document.title = janin.currency.name() + "'s paper wallet generator";
// Regenerate a new wallet when not expensive
ninja.wallets.singlewallet.generateNewAddressAndKey();
ninja.wallets.paperwallet.build(document.getElementById('paperpassphrase').value);

View file

@ -36,9 +36,12 @@ janin.currency = {
useCurrency: function(index) {
janin.selectedCurrency = janin.currencies[index];
var coinImgUrl = "logos/" + janin.selectedCurrency.name.toLowerCase() + ".png";
var coinImgUrl = "logos/" + janin.currency.name().toLowerCase() + ".png";
document.getElementById("coinLogoImg").src = coinImgUrl;
// Update title depending on currency
document.title = janin.currency.name() + "'s paper wallet generator";
// Regenerate a new wallet when not expensive
ninja.wallets.singlewallet.generateNewAddressAndKey();
ninja.wallets.paperwallet.build(document.getElementById('paperpassphrase').value);