Refresh only the currency dependent parts on a currency change
This commit is contained in:
1 parent
29657b6e15
commit
7235697405
1 file changed
+12
@@ -310,6 +310,18 @@
|
||||
});
|
||||
}
|
||||
|
||||
/* What depends on the currency of the outgoing leg (docs/spec.md section 3.11). */
|
||||
function syncDestination() {
|
||||
var spec = currentType();
|
||||
var destination = document.querySelector('[name="to_market"]');
|
||||
var kroner = Skuld.fieldValue("leg_out_currency") === "nok";
|
||||
destination.required = Boolean(spec.to) && !kroner;
|
||||
var destinationHint = document.querySelector("[data-destination-hint]");
|
||||
if (destinationHint) {
|
||||
destinationHint.hidden = !spec.to || !kroner;
|
||||
}
|
||||
}
|
||||
|
||||
function applyType() {
|
||||
var spec = currentType();
|
||||
[["leg_in", spec.in], ["leg_out", spec.out]].forEach(function (pair) {
|
||||
|
||||
Reference in new issue
Block a user