Ticket #2022: patch.diff

File patch.diff, 1.7 KB (added by tom@…, 18 years ago)

Here's a patch

  • django/contrib/admin/media/js/admin/RelatedObjectLookups.js

     
    3232    return false;
    3333}
    3434
     35function showChangePopup(id, url)
     36{
     37    select = document.getElementById(id)
     38    value = select.options[select.selectedIndex].value;
     39    if (value)
     40    {
     41        var win = window.open(url+value + '?_popup=1', id, 'height=500,width=800,resizable=yes,scrollbars=yes');
     42        win.focus();
     43    }
     44    return false;
     45}
     46
    3547function dismissAddAnotherPopup(win, newId, newRepr) {
    3648    var name = win.name.replace(/___/g, '.');
    3749    var elem = document.getElementById(name);
  • django/contrib/admin/templates/widget/foreign.html

     
    99{% else %}
    1010{% if bound_field.needs_add_label %}
    1111    <a href="{{ bound_field.related_url }}add/" class="add-another" id="add_{{ bound_field.element_id }}" onclick="return showAddAnotherPopup(this);"> <img src="{% admin_media_prefix %}img/admin/icon_addlink.gif" width="10" height="10" alt="Add Another"/></a>
     12    <a href="{{ bound_field.related_url }}" class="changelink" id="change_{{ bound_field.element_id }}" onclick="return showChangePopup('{{ bound_field.element_id }}', '{{ bound_field.related_url }}');"></a>
    1213{% endif %}{% endif %}
    1314{% if change %}
    1415    {% if bound_field.field.primary_key %}
Back to Top