Ticket #9539: patch.diff
File patch.diff, 1.9 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/media/js/admin/RelatedObjectLookups.js
13 13 14 14 function showRelatedObjectLookupPopup(triggeringLink) { 15 15 var name = triggeringLink.id.replace(/^lookup_/, ''); 16 // IE doesn't like periods in the window name, so convert temporarily. 17 name = name.replace(/\./g, '___'); 16 // IE doesn't like periods or dashes in the window name, so convert temporarily. 17 name = name.replace(/\./g, '___dot___'); 18 name = name.replace(/\-/g, '___dash___'); 18 19 var href; 19 20 if (triggeringLink.href.search(/\?/) >= 0) { 20 21 href = triggeringLink.href + '&pop=1'; … … 27 28 } 28 29 29 30 function dismissRelatedLookupPopup(win, chosenId) { 30 var name = win.name.replace(/___/g, '.'); 31 var name = win.name.replace(/___dot___/g, '.'); 32 var name = win.name.replace(/___dash___/g, '-'); 31 33 var elem = document.getElementById(name); 32 34 if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { 33 35 elem.value += ',' + chosenId; … … 39 41 40 42 function showAddAnotherPopup(triggeringLink) { 41 43 var name = triggeringLink.id.replace(/^add_/, ''); 42 name = name.replace(/\./g, '___'); 44 name = name.replace(/\./g, '___dot___'); 45 name = name.replace(/\-/g, '___dash___'); 43 46 href = triggeringLink.href 44 47 if (href.indexOf('?') == -1) { 45 48 href += '?_popup=1'; … … 56 59 // django.utils.html.escape. 57 60 newId = html_unescape(newId); 58 61 newRepr = html_unescape(newRepr); 59 var name = win.name.replace(/___/g, '.'); 62 var name = win.name.replace(/___dot___/g, '.'); 63 var name = win.name.replace(/___dash___/g, '-'); 60 64 var elem = document.getElementById(name); 61 65 if (elem) { 62 66 if (elem.nodeName == 'SELECT') {