1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-23 16:02:25 +00:00
nk20/static/admin/js/prepopulate_init.js
Pierre-antoine Comby 70c09da9f8 add static files
2020-02-25 22:15:46 +01:00

11 lines
495 B
JavaScript

(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);