[js] Fix modal window not closing on save with `django >= 4.0`. #169

my-merge-progressivo1^2
Fabio Caccamo 2022-09-28 16:34:26 +02:00
parent 990db6fdc8
commit 585575dce7
1 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,7 @@
'use strict';
var windowRef = window;
var windowRefProxy;
var windowName, widgetName;
var openerRef = windowRef.opener;
if (!openerRef) {
@ -14,12 +15,14 @@
// django < 3.1 compatibility
widgetName = openerRef.id_to_windowname(widgetName);
}
windowRef = {
windowRefProxy = {
name: widgetName,
location: windowRef.location,
close: function() {
openerRef.dismissRelatedObjectModal();
}
};
windowRef = windowRefProxy;
}
// default django popup_response.js