btcpayserver/BTCPayServer/wwwroot/js/wallet/wallet-camera-scanner.js
d11n a8e16b0ba6
Wallet UI quick wins (#5851)
- Unify single/multiple inputs display
- Destination: Move labels above amount
- Coin Selection: Add sorting by amount and confirmations, add page size. Closes #5850
- Move PSBT and BIP21 buttons up to input related button group
- Turn checkboxes in Advanced Settings into toggles
- Improve spacings and button groups
2024-05-06 14:40:17 +09:00

15 lines
631 B
JavaScript

window.addEventListener("load", () => {
let $input = null;
initCameraScanningApp("Scan address or payment link", data => {
if (data.includes('?') || $input == null) {
document.getElementById("BIP21").value = data;
document.getElementById("SendForm").submit();
} else {
$input.value = data;
}
}, "scanModal");
document.getElementById('scanModal').addEventListener('show.bs.modal', e => {
const { index } = e.relatedTarget.dataset;
$input = index ? document.querySelector(`[name="Outputs[${index}].DestinationAddress"]`) : null;
});
});