Ticket #1404: trunk-admin_popup_selectfilter_fix.diff
File trunk-admin_popup_selectfilter_fix.diff, 1.2 KB (added by , 19 years ago) |
---|
-
contrib/admin/media/js/admin/RelatedObjectLookups.js
29 29 function dismissAddAnotherPopup(win, newId, newRepr) { 30 30 var name = win.name.replace(/___/g, '.') 31 31 var elem = document.getElementById(name); 32 if (elem.nodeName == 'SELECT') { 32 if (elem) { 33 if (elem.nodeName == 'SELECT') { 34 var o = new Option(newRepr, newId); 35 elem.options[elem.options.length] = o 36 elem.selectedIndex = elem.length - 1; 37 } else if (elem.nodeName == 'INPUT') { 38 elem.value = newId; 39 } 40 } else { 41 var toId = name + "_to"; 42 elem = document.getElementById(toId); 33 43 var o = new Option(newRepr, newId); 34 elem.options[elem.options.length] = o 35 elem.selectedIndex = elem.length - 1; 36 } else if (elem.nodeName == 'INPUT') { 37 elem.value = newId; 44 SelectBox.add_to_cache(toId, o); 45 SelectBox.redisplay(toId); 38 46 } 39 47 win.close(); 40 48 }