summaryrefslogtreecommitdiff
path: root/src/static/admin/js/cancel.js
blob: 8809ee773fd2dad2ade7d0fe264dde02ed22d3b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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);