Ticket #1635: django_1635.diff
File django_1635.diff, 1.1 KB (added by , 19 years ago) |
---|
-
django/contrib/admin/media/js/admin/RelatedObjectLookups.js
2 2 // and Add Another links. 3 3 4 4 function showRelatedObjectLookupPopup(triggeringLink) { 5 var name = triggeringLink.id.replace(/^lookup_/, ''); 5 var name = triggeringLink.id.replace(/^lookup_/, ''); 6 name = name.replace(/\./g, '___'); 6 7 var href; 7 8 if (triggeringLink.href.search(/\?/) >= 0) { 8 9 href = triggeringLink.href + '&pop=1'; … … 15 16 } 16 17 17 18 function dismissRelatedLookupPopup(win, chosenId) { 18 var elem = document.getElementById(win.name); 19 var name = win.name.replace(/___/g, '.'); 20 var elem = document.getElementById(name); 19 21 if (elem.className.indexOf('vRawIdAdminField') != -1 && elem.value) { 20 22 elem.value += ',' + chosenId; 21 23 } else { 22 document.getElementById( win.name).value = chosenId;24 document.getElementById(name).value = chosenId; 23 25 } 24 26 win.close(); 25 27 }