Skip to content

Commit 11a8084

Browse files
Fixed #4556 -- Admin showAddAnotherPopup JavaScript function can now handle URLs with GET attributes. Thanks for the patch, glin@seznam.cz
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5500 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent bb5734e commit 11a8084

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

django/contrib/admin/media/js/admin/RelatedObjectLookups.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ function dismissRelatedLookupPopup(win, chosenId) {
3030
function showAddAnotherPopup(triggeringLink) {
3131
var name = triggeringLink.id.replace(/^add_/, '');
3232
name = name.replace(/\./g, '___');
33-
var win = window.open(triggeringLink.href + '?_popup=1', name, 'height=500,width=800,resizable=yes,scrollbars=yes');
33+
href = triggeringLink.href
34+
if (href.indexOf('?') == -1)
35+
href += '?_popup=1';
36+
else
37+
href += '&_popup=1';
38+
var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes');
3439
win.focus();
3540
return false;
3641
}

0 commit comments

Comments
 (0)