184df9240ce76e1508086ac5bef6600c81809643
[emels.git] / emels / static / admin / js / prepopulate_init.js
1 (function($) {
2     'use strict';
3     var fields = $('#django-admin-prepopulated-fields-constants').data('prepopulatedFields');
4     $.each(fields, function(index, field) {
5         $('.empty-form .form-row .field-' + field.name + ', .empty-form.form-row .field-' + field.name).addClass('prepopulated_field');
6         $(field.id).data('dependency_list', field.dependency_list).prepopulate(
7             field.dependency_ids, field.maxLength, field.allowUnicode
8         );
9     });
10 })(django.jQuery);