3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-30 00:22:26 +00:00
coope/static/admin/js/cancel.js

13 lines
410 B
JavaScript

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