diff options
Diffstat (limited to 'website/static/admin/js/popup_response.js')
-rw-r--r-- | website/static/admin/js/popup_response.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/website/static/admin/js/popup_response.js b/website/static/admin/js/popup_response.js new file mode 100644 index 0000000..b4a07e7 --- /dev/null +++ b/website/static/admin/js/popup_response.js @@ -0,0 +1,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; + } +})(); |