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