Ticket #6183: django-6183-better.patch

File django-6183-better.patch, 1.1 KB (added by Chris Adams, 14 years ago)

Much smaller patch, tested in Safari/IE/Firefox/Chrome

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

    old new  
    2020        from_box.id += '_from'; // change its ID
    2121        from_box.className = 'filtered';
    2222
    23         // Remove <p class="info">, because it just gets in the way.
    2423        var ps = from_box.parentNode.getElementsByTagName('p');
    2524        for (var i=0; i<ps.length; i++) {
    26             from_box.parentNode.removeChild(ps[i]);
     25            if (ps[i].className.indexOf("info") != -1) {
     26                // Remove <p class="info">, because it just gets in the way.
     27                from_box.parentNode.removeChild(ps[i]);
     28            } else if (ps[i].className.indexOf("help") != -1) {
     29                // Move help text up to the top so it isn't below the select
     30                // boxes or wrapped off on the side to the right of the add
     31                // button:
     32                from_box.parentNode.insertBefore(ps[i], from_box.parentNode.firstChild);
     33            }
    2734        }
    2835
    2936        // <div class="selector"> or <div class="selector stacked">
Back to Top