1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-23 16:02:25 +00:00
nk20/static/admin/js/cancel.js

14 lines
409 B
JavaScript
Raw Normal View History

2020-02-25 21:15:46 +00:00
(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);