From 1fb3d381e832d5c5871c6cb2fd8b2c1ae3dbd029 Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Thu, 20 Feb 2020 12:58:59 +0530 Subject: Add user registration, login and abstract submission interfaces --- static/admin/js/cancel.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 static/admin/js/cancel.js (limited to 'static/admin/js/cancel.js') diff --git a/static/admin/js/cancel.js b/static/admin/js/cancel.js new file mode 100644 index 0000000..04ec812 --- /dev/null +++ b/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