~singpolyma/jmp-pay

0238ab4630c9564baae369f5db8018de74b2d021 — Stephen Paul Weber 27 days ago e275d7b
Request submit of credit card form when pushing next in the app
1 files changed, 10 insertions(+), 0 deletions(-)

M views/credit_cards.slim
M views/credit_cards.slim => views/credit_cards.slim +10 -0
@@ 48,6 48,16 @@ javascript:
		document.querySelector("input[name=atfd]").value = atfd;
	}

	if (window.xmpp_xep0050) {
		xmpp_xep0050.preventDefault();

		window.addEventListener("message", (ev) => {
			if (ev.data === "xmpp_xep0050/next") {
				document.querySelector("form").requestSubmit();
			}
		});
	}

	var button = document.createElement("button");
	button.innerHTML = "Save";
	document.querySelector("form").appendChild(button);