Skip to content

Commit

Permalink
scroll new forms into view (e.g. continue button)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomConner committed Nov 22, 2023
1 parent 5c82fbb commit ef15221
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions generator/static/js/register-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ window.addEventListener("load", (event) => {
stripeFrame.src = `/register?q=${lookup_code}`;
stripeFrame.contentWindow.addEventListener('message', onStripeFrameMessage, false);
stripeFrame.hidden = false;
stripeFrame.scrollIntoView();
}

// dispatch messages from stripeFrame
Expand All @@ -229,7 +230,6 @@ window.addEventListener("load", (event) => {
}

// Handle the message here
console.debug('Stripe message:', event.data);

switch (event.data.m) {
case 'frame_scrollIntoView':
Expand All @@ -239,7 +239,8 @@ window.addEventListener("load", (event) => {
//TODO height of frame

default:
console.error('unhandled message:', event.data);
console.debug(`message from ${event.origin}:`);
console.debug(event.data);
break;
}
}
Expand Down

0 comments on commit ef15221

Please sign in to comment.