MCPcopy
hub / github.com/django/django / handleClick

Function handleClick

django/contrib/admin/static/admin/js/cancel.js:15–23  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected