diff --git a/static/transaction.js b/static/transaction.js index f426bf8..11c8600 100644 --- a/static/transaction.js +++ b/static/transaction.js @@ -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) {