Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Jacob Kaplan-Moss authored September 29, 2005
8  django/conf/admin_media/js/admin/RelatedObjectLookups.js
@@ -20,19 +20,21 @@ function dismissRelatedLookupPopup(win, chosenId) {
20 20
 
21 21
 function showAddAnotherPopup(triggeringLink) {
22 22
     var name = triggeringLink.id.replace(/^add_/, '');
  23
+    name = name.replace(/\./g, '___');
23 24
     var win = window.open(triggeringLink.href + '?_popup=1', name, 'height=500,width=800,resizable=yes,scrollbars=yes');
24 25
     win.focus();
25 26
     return false;
26 27
 }
27 28
 
28 29
 function dismissAddAnotherPopup(win, newId, newRepr) {
29  
-    var elem = document.getElementById(win.name);
  30
+    var name = win.name.replace(/___/g, '.')
  31
+    var elem = document.getElementById(name);
30 32
     if (elem.nodeName == 'SELECT') {
31 33
         var o = new Option(newRepr, newId);
32  
-        elem.appendChild(o);
  34
+        elem.options[elem.options.length] = o
33 35
         elem.selectedIndex = elem.length - 1;
34 36
     } else if (elem.nodeName == 'INPUT') {
35 37
         elem.value = newId;
36 38
     }
37 39
     win.close();
38  
-}
  40
+}

0 notes on commit 808b3f4

Please sign in to comment.
Something went wrong with that request. Please try again.