File tree Expand file tree Collapse file tree
modules/servers/openproviderpremiumdns Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8282 <script>
8383 document.addEventListener("DOMContentLoaded", function () {
8484 // ===== confirm before deleting a PDNS zone =====
85- const deleteBtn = document.querySelector("a[menuitemname='Custom Module Button Delete PDNS Zone']");
86- if (deleteBtn) {
87- deleteBtn.addEventListener("click", function (e) {
85+ document.addEventListener("click", function (e) {
86+ if (!e.target || typeof e.target.closest !== "function") {
87+ return;
88+ }
89+ const deleteBtn = e.target.closest("a[menuitemname='Custom Module Button Delete PDNS Zone'], a[href*='a=TerminateAccount']");
90+ if (deleteBtn) {
8891 const confirmed = confirm("⚠️ Are you sure you want to delete this PDNS zone? This action cannot be undone.");
8992 if (!confirmed) {
9093 e.preventDefault();
94+ e.stopPropagation();
95+ e.stopImmediatePropagation();
96+ return;
9197 }
92- });
93- }
98+ }
99+ }, true);
94100
95101 // ===== Banner for the 3rd flow: "I will use my existing domain and update my nameservers" =====
96102 const ownDomainInput = document.querySelector("input[name='domainoption'][value='owndomain']");
You can’t perform that action at this time.
0 commit comments