Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 808b3f4b9180dbcd4a8a84323b44a58b9bcdbd4a 1 parent 8a7189f
@jacobian jacobian authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 django/conf/admin_media/js/admin/RelatedObjectLookups.js
View
8 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();
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.