Skip to content

Commit

Permalink
Merge pull request #20 from TheGiddyLimit/bugfix/simplify-form-acquis…
Browse files Browse the repository at this point in the history
…ition

Simplify acquisition of form element
  • Loading branch information
JarrettSpiker authored Sep 9, 2023
2 parents 8345194 + 3fd44df commit d313017
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/scripts/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ Hooks.on("renderInvitationLinks", (links:InvitationLinks, html:JQuery) => {
// If the window was reloaded, the JQuery is the Form
let formHtml : HTMLFormElement | undefined;
if(windowContent.classList.contains("window-app") && windowContent instanceof HTMLDivElement){
let potentialForm = windowContent.lastElementChild?.lastElementChild;
if(potentialForm instanceof HTMLFormElement){
formHtml = potentialForm;
}
formHtml = windowContent.querySelector("form");
} else if(windowContent instanceof HTMLFormElement){
formHtml = windowContent;
}
Expand Down

0 comments on commit d313017

Please sign in to comment.