1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 02:23:50 +00:00
nk20/static/admin/js/popup_response.js

17 lines
569 B
JavaScript
Raw Normal View History

2020-02-25 21:15:46 +00:00
/*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;
}
})();