Ticket #7985: 7985.patch
File 7985.patch, 1.2 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/templates/admin/change_form.html
62 62 {% if add %} 63 63 <script type="text/javascript"> 64 64 {% for field in adminform.prepopulated_fields %} 65 document.getElementById("{{ field.field.auto_id }}").onchange = function() { this._changed = true; };65 addEvent(document.getElementById("{{ field.field.auto_id }}"), 'change', function() { this._changed = true; }); 66 66 {% for dependency in field.dependencies %} 67 document.getElementById("{{ dependency.auto_id }}").onkeyup =function() {67 addEvent(document.getElementById("{{ dependency.auto_id }}"), 'keyup', function() { 68 68 var e = document.getElementById("{{ field.field.auto_id }}"); 69 69 if (!e._changed) { e.value = URLify({% for innerdep in field.dependencies %}document.getElementById("{{ innerdep.auto_id }}").value{% if not forloop.last %} + ' ' + {% endif %}{% endfor %}, {{ field.field.field.max_length }}); } 70 } 70 }); 71 71 {% endfor %} 72 72 {% endfor %} 73 73 </script>