Ticket #106: RelatedObjectLookups.js.patch
File RelatedObjectLookups.js.patch, 1.1 KB (added by , 19 years ago) |
---|
-
django/conf/admin_media/js/admin/RelatedObjectLookups.js
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 } 39 No newline at end of file 40 }