(event)
| 13 | |
| 14 | ready(function () { |
| 15 | function handleClick(event) { |
| 16 | event.preventDefault(); |
| 17 | const params = new URLSearchParams(window.location.search); |
| 18 | if (params.has("_popup")) { |
| 19 | window.close(); // Close the popup. |
| 20 | } else { |
| 21 | window.history.back(); // Otherwise, go back. |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | document.querySelectorAll(".cancel-link").forEach(function (el) { |
| 26 | el.addEventListener("click", handleClick); |