diff options
Diffstat (limited to 'static/admin/js/prepopulate_init.js')
-rw-r--r-- | static/admin/js/prepopulate_init.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/static/admin/js/prepopulate_init.js b/static/admin/js/prepopulate_init.js new file mode 100644 index 0000000..184df92 --- /dev/null +++ b/static/admin/js/prepopulate_init.js @@ -0,0 +1,10 @@ +(function($) { + 'use strict'; + var fields = $('#django-admin-prepopulated-fields-constants').data('prepopulatedFields'); + $.each(fields, function(index, field) { + $('.empty-form .form-row .field-' + field.name + ', .empty-form.form-row .field-' + field.name).addClass('prepopulated_field'); + $(field.id).data('dependency_list', field.dependency_list).prepopulate( + field.dependency_ids, field.maxLength, field.allowUnicode + ); + }); +})(django.jQuery); |