summaryrefslogtreecommitdiff
path: root/static/admin/js/cancel.js
blob: 04ec812a4a8c0fd70fb5d4a53db60b4c3f54f9c4 (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);