mirror of
https://github.com/django/django.git
synced 2025-07-05 10:19:20 +00:00
small change to undo javascript testing modification
git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@783 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e3f3d4e86f
commit
0b8ce51ce6
@ -180,7 +180,7 @@ def auto_populated_field_script(auto_pop_fields, change = False):
|
||||
|
||||
add_values = ' + " " + '.join(['document.getElementById("id_%s").value' % g for g in field.prepopulate_from])
|
||||
for f in field.prepopulate_from:
|
||||
t.append('document.getElementById("id_%s").onkeyup = function() { var e = document.getElementById("id_%s"); if(e._changed) { e.value = URLify(%s, %s);} } ' % (f, field.name, add_values, field.maxlength) )
|
||||
t.append('document.getElementById("id_%s").onkeyup = function() { var e = document.getElementById("id_%s"); if(!e._changed) { e.value = URLify(%s, %s);} } ' % (f, field.name, add_values, field.maxlength) )
|
||||
|
||||
return ''.join(t)
|
||||
auto_populated_field_script = simple_tag(auto_populated_field_script)
|
||||
|
@ -988,7 +988,7 @@ def _get_template(opts, app_label, add=False, change=False, show_delete=False, f
|
||||
else:
|
||||
t.append('document.getElementById("id_%s").onchange = function() { this._changed = true; };' % field.name)
|
||||
for f in field.prepopulate_from:
|
||||
t.append('document.getElementById("id_%s").onkeyup = function() { var e = document.getElementById("id_%s"); if (e._changed) { e.value = URLify(%s, %s);}};' % \
|
||||
t.append('document.getElementById("id_%s").onkeyup = function() { var e = document.getElementById("id_%s"); if (!e._changed) { e.value = URLify(%s, %s);}};' % \
|
||||
(f, field.name, ' + " " + '.join(['document.getElementById("id_%s").value' % g for g in field.prepopulate_from]), field.maxlength))
|
||||
t.append('</script>\n')
|
||||
if change and ordered_objects:
|
||||
|
Loading…
x
Reference in New Issue
Block a user