mybuddy/static/admin/js/prepopulate_init.js

16 lines
586 B
JavaScript
Raw Normal View History

2020-10-24 02:58:05 +00:00
'use strict';
{
const $ = django.jQuery;
const fields = $('#django-admin-prepopulated-fields-constants').data('prepopulatedFields');
$.each(fields, function(index, field) {
2022-10-13 02:04:59 +00:00
$(
'.empty-form .form-row .field-' + field.name +
', .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
);
});
2020-10-24 02:58:05 +00:00
}