refactor the currency selection when initializing the application in a cleaner and safer way.
This commit is contained in:
parent
07b64959ca
commit
94994a1930
2 changed files with 22 additions and 24 deletions
|
@ -13161,13 +13161,12 @@ if (ninja.getQueryString()["showseedpool"] == "true" || ninja.getQueryString()["
|
|||
document.getElementById("seedpoolarea").style.display = "block";
|
||||
}
|
||||
// change currency
|
||||
janin.currency.useCurrency(4);
|
||||
if (ninja.getQueryString()["currency"] != undefined) {
|
||||
var currency = ninja.getQueryString()["currency"] || "bitcoin";
|
||||
currency = currency.toLowerCase();
|
||||
for(i = 0; i < janin.currencies.length; i++) {
|
||||
if (janin.currencies[i].name.toLowerCase() == ninja.getQueryString()["currency"].toLowerCase())
|
||||
if (janin.currencies[i].name.toLowerCase() == currency)
|
||||
janin.currency.useCurrency(i);
|
||||
}
|
||||
}
|
||||
// populate currency dropdown list
|
||||
var select = document.getElementById("currency");
|
||||
var options = "";
|
||||
|
|
|
@ -6,13 +6,12 @@ if (ninja.getQueryString()["showseedpool"] == "true" || ninja.getQueryString()["
|
|||
document.getElementById("seedpoolarea").style.display = "block";
|
||||
}
|
||||
// change currency
|
||||
janin.currency.useCurrency(4);
|
||||
if (ninja.getQueryString()["currency"] != undefined) {
|
||||
var currency = ninja.getQueryString()["currency"] || "bitcoin";
|
||||
currency = currency.toLowerCase();
|
||||
for(i = 0; i < janin.currencies.length; i++) {
|
||||
if (janin.currencies[i].name.toLowerCase() == ninja.getQueryString()["currency"].toLowerCase())
|
||||
if (janin.currencies[i].name.toLowerCase() == currency)
|
||||
janin.currency.useCurrency(i);
|
||||
}
|
||||
}
|
||||
// populate currency dropdown list
|
||||
var select = document.getElementById("currency");
|
||||
var options = "";
|
||||
|
|
Loading…
Add table
Reference in a new issue