summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2005-09-29 13:02:34 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2005-09-29 13:02:34 +0000
commit808b3f4b9180dbcd4a8a84323b44a58b9bcdbd4a (patch)
treedf047468cf5dd1b202836e2c6bf1682ded69b6f0
parent8a7189f38f08c515e7302a484d7af0c215e92973 (diff)
Fixed #106 - "Add another" now correctly works in IE - thanks, Paolo
git-svn-id: http://code.djangoproject.com/svn/django/trunk@716 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/conf/admin_media/js/admin/RelatedObjectLookups.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/django/conf/admin_media/js/admin/RelatedObjectLookups.js b/django/conf/admin_media/js/admin/RelatedObjectLookups.js
index 0f68921745..3788e048b2 100644
--- a/django/conf/admin_media/js/admin/RelatedObjectLookups.js
+++ b/django/conf/admin_media/js/admin/RelatedObjectLookups.js
@@ -20,19 +20,21 @@ 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');
win.focus();
return false;
}
function dismissAddAnotherPopup(win, newId, newRepr) {
- var elem = document.getElementById(win.name);
+ var name = win.name.replace(/___/g, '.')
+ var elem = document.getElementById(name);
if (elem.nodeName == 'SELECT') {
var o = new Option(newRepr, newId);
- elem.appendChild(o);
+ elem.options[elem.options.length] = o
elem.selectedIndex = elem.length - 1;
} else if (elem.nodeName == 'INPUT') {
elem.value = newId;
}
win.close();
-} \ No newline at end of file
+}