Ticket #9264: 9264.patch
File 9264.patch, 1.2 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/templates/admin/prepopulated_fields_js.html
1 1 <script type="text/javascript"> 2 2 {% for field in prepopulated_fields %} 3 document.getElementById("{{ field.field.auto_id }}").onchange = function() { this._changed = true; };3 addEvent(document.getElementById("{{ field.field.auto_id }}"), 'change', function() { this._changed = true; }); 4 4 {% for dependency in field.dependencies %} 5 document.getElementById("{{ dependency.auto_id }}").onkeyup =function() {5 addEvent(document.getElementById("{{ dependency.auto_id }}"), 'keyup', function() { 6 6 var e = document.getElementById("{{ field.field.auto_id }}"); 7 7 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|default_if_none:"50" }}); } 8 } 8 }); 9 9 {% endfor %} 10 10 {% endfor %} 11 11 </script>