Show the unit of a fixed currency and open a choice on its default
This commit is contained in:
1 parent
8f345127e8
commit
c8bc53eb43
1 file changed
+10
-3
+10
-3
@@ -318,12 +318,19 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
label(name).textContent = settings.label;
|
label(name).textContent = settings.label;
|
||||||
|
var choice = settings.currencies.length > 1;
|
||||||
var currencySelect = document.querySelector('[name="' + name + '_currency"]');
|
var currencySelect = document.querySelector('[name="' + name + '_currency"]');
|
||||||
var fixed = settings.currencies.length === 1;
|
currencySelect.hidden = !choice;
|
||||||
currencySelect.hidden = fixed;
|
currencySelect.value = settings.default || settings.currencies[0];
|
||||||
currencySelect.value = settings.currencies[0];
|
var unitSlot = unit(name);
|
||||||
|
unitSlot.hidden = choice;
|
||||||
|
unitSlot.textContent = UNIT_LABELS[settings.currencies[0]];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// The price is always in kroner and a fee always in sats (section 7.3).
|
||||||
|
unit("value").textContent = UNIT_LABELS.nok;
|
||||||
|
unit("fee").textContent = UNIT_LABELS.sats;
|
||||||
|
|
||||||
group("value").hidden = !spec.value;
|
group("value").hidden = !spec.value;
|
||||||
if (spec.value) {
|
if (spec.value) {
|
||||||
label("value").textContent = spec.value.label;
|
label("value").textContent = spec.value.label;
|
||||||
|
|||||||
Reference in new issue
Block a user