From ce32a56cdfdd7f86dbedff55e481e852eb9a62c4 Mon Sep 17 00:00:00 2001 From: Fabio Caccamo Date: Tue, 13 Nov 2018 10:19:24 +0100 Subject: [PATCH] Fixed #44 - raw_id_fields issue with django 2.1 --- .../static/admin_interface/related-modal/related-modal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin_interface/static/admin_interface/related-modal/related-modal.js b/admin_interface/static/admin_interface/related-modal/related-modal.js index 2d5fbd9..321048d 100644 --- a/admin_interface/static/admin_interface/related-modal/related-modal.js +++ b/admin_interface/static/admin_interface/related-modal/related-modal.js @@ -61,7 +61,7 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined') // create a random parameter and append it to the src url to prevent it // this workaround doesn't work with related lookup url var iframeSrcRandom = String(Math.round(Math.random() * 999999)); - if( iframeSrc.indexOf('?') === -1 ){ + if (iframeSrc.indexOf('?') === -1) { iframeSrc += '?_modal=' + iframeSrcRandom; } else { iframeSrc += '&_modal=' + iframeSrcRandom; @@ -86,7 +86,7 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined') { // set current window as iframe opener because // the callback is called on the opener window - iframeEl.load(function(){ + iframeEl.on('load', function() { var iframeObj = $(this).get(0); var iframeWindow = iframeObj.contentWindow; iframeWindow.opener = window;