summaryrefslogtreecommitdiff
path: root/static/admin/js/popup_response.js
blob: b4a07e7454b3a570f1958f570fec04de45fbf8c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*global opener */
(function() {
    'use strict';
    var initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse);
    switch(initData.action) {
    case 'change':
        opener.dismissChangeRelatedObjectPopup(window, initData.value, initData.obj, initData.new_value);
        break;
    case 'delete':
        opener.dismissDeleteRelatedObjectPopup(window, initData.value);
        break;
    default:
        opener.dismissAddRelatedObjectPopup(window, initData.value, initData.obj);
        break;
    }
})();