Ticket #106: RelatedObjectLookups.js.patch

File RelatedObjectLookups.js.patch, 1.1 KB (added by paolo <paolo@…>, 19 years ago)

patch

  • django/conf/admin_media/js/admin/RelatedObjectLookups.js

     
    2020
    2121function showAddAnotherPopup(triggeringLink) {
    2222    var name = triggeringLink.id.replace(/^add_/, '');
     23    name = name.replace(/\./g, '___');
    2324    var win = window.open(triggeringLink.href + '?_popup=1', name, 'height=500,width=800,resizable=yes,scrollbars=yes');
    2425    win.focus();
    2526    return false;
    2627}
    2728
    2829function dismissAddAnotherPopup(win, newId, newRepr) {
    29     var elem = document.getElementById(win.name);
     30    var name = win.name.replace(/___/g, '.')
     31    var elem = document.getElementById(name);
    3032    if (elem.nodeName == 'SELECT') {
    3133        var o = new Option(newRepr, newId);
    32         elem.appendChild(o);
     34        elem.options[elem.options.length] = o
    3335        elem.selectedIndex = elem.length - 1;
    3436    } else if (elem.nodeName == 'INPUT') {
    3537        elem.value = newId;
    3638    }
    3739    win.close();
    38 }
    39  No newline at end of file
     40}
Back to Top