popup_response.js 569 B

12345678910111213141516
  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. })();