Skip to content

Commit

Permalink
Update confirm.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxodin committed Mar 24, 2023
1 parent 50322fc commit b31b649
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions confirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ document.addEventListener('submit', e=>{
if (btn && btn.hasAttribute('u1-confirm')) element = btn;
if (!element) return;

confirmEvent(e, element, ()=>
form.requestSubmit(btn)
);
confirmEvent(e, element, ()=> form.requestSubmit(btn) );
},true);

// click
Expand All @@ -26,9 +24,7 @@ document.addEventListener('click', e=>{
if (!element) return;
if (element.form && element.type==='submit') return; // handled by submit event. What about "reset"?

confirmEvent(e, element, ()=>
element.click()
);
confirmEvent(e, element, ()=> element.click() );
},true);

async function confirmEvent(e, element, then){
Expand Down

0 comments on commit b31b649

Please sign in to comment.