From 11a8084d4f77842b476de3687319ca243663d7df Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Wed, 20 Jun 2007 06:12:43 +0000 Subject: [PATCH] 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 --- .../contrib/admin/media/js/admin/RelatedObjectLookups.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/django/contrib/admin/media/js/admin/RelatedObjectLookups.js b/django/contrib/admin/media/js/admin/RelatedObjectLookups.js index db4ed1a9d1..e5e05a7e32 100644 --- a/django/contrib/admin/media/js/admin/RelatedObjectLookups.js +++ b/django/contrib/admin/media/js/admin/RelatedObjectLookups.js @@ -30,7 +30,12 @@ function dismissRelatedLookupPopup(win, chosenId) { function showAddAnotherPopup(triggeringLink) { var name = triggeringLink.id.replace(/^add_/, ''); name = name.replace(/\./g, '___'); - var win = window.open(triggeringLink.href + '?_popup=1', name, 'height=500,width=800,resizable=yes,scrollbars=yes'); + href = triggeringLink.href + if (href.indexOf('?') == -1) + href += '?_popup=1'; + else + href += '&_popup=1'; + var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes'); win.focus(); return false; }