Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

magic-removal: Fixed #1063 -- Fixed admin JS bug in which many-to-man…

…y selections were lost after using 'Add another'

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2740 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9b8332f7df6261c50ad5b32e8a49bc307027a285 1 parent 2d5d40a
Adrian Holovaty authored April 23, 2006
2  django/contrib/admin/media/js/admin/RelatedObjectLookups.js
@@ -39,7 +39,7 @@ function dismissAddAnotherPopup(win, newId, newRepr) {
39 39
         if (elem.nodeName == 'SELECT') {
40 40
             var o = new Option(newRepr, newId);
41 41
             elem.options[elem.options.length] = o;
42  
-            elem.selectedIndex = elem.length - 1;
  42
+            o.selected = true;
43 43
         } else if (elem.nodeName == 'INPUT') {
44 44
             elem.value = newId;
45 45
         }

0 notes on commit 9b8332f

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