From cfb4bf6be1b18ec15cddbec1ea37e76176b1050b Mon Sep 17 00:00:00 2001 From: ckonstanski Date: Thu, 30 Jul 2026 17:56:41 -0600 Subject: initial commit --- src/static/admin/js/cancel.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/static/admin/js/cancel.js (limited to 'src/static/admin/js/cancel.js') diff --git a/src/static/admin/js/cancel.js b/src/static/admin/js/cancel.js new file mode 100644 index 0000000..8809ee7 --- /dev/null +++ b/src/static/admin/js/cancel.js @@ -0,0 +1,13 @@ +(function($) { + 'use strict'; + $(function() { + $('.cancel-link').on('click', function(e) { + e.preventDefault(); + if (window.location.search.indexOf('&_popup=1') === -1) { + window.history.back(); // Go back if not a popup. + } else { + window.close(); // Otherwise, close the popup. + } + }); + }); +})(django.jQuery); -- cgit v1.3