feat(grfn/bbbg): Add delete event button
Change-Id: I763e7a6b367ea5b474ab3aa13c7ff21e99db34af Reviewed-on: https://cl.tvl.fyi/c/depot/+/5023 Reviewed-by: grfn <grfn@gws.fyi> Autosubmit: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
This commit is contained in:
parent
86496ca4cd
commit
c364b1273b
3 changed files with 50 additions and 13 deletions
|
|
@ -58,10 +58,16 @@ window.onload = () => {
|
|||
}
|
||||
|
||||
document.querySelectorAll("form").forEach((form) => {
|
||||
form.onsubmit = (e) => {
|
||||
form.addEventListener("submit", (e) => {
|
||||
if (e.target.attributes.disabled) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
|
||||
const confirmMessage = e.target.dataset.confirm;
|
||||
if (confirmMessage != null && !confirm(confirmMessage)) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue