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

2 lines
379 B
JavaScript

(function(b){b.fn.prepopulate=function(d,f,g){return this.each(function(){var a=b(this),h=function(){if(!a.data("_changed")){var e=[];b.each(d,function(a,c){c=b(c);0<c.val().length&&e.push(c.val())});a.val(URLify(e.join(" "),f,g))}};a.data("_changed",!1);a.on("change",function(){a.data("_changed",!0)});if(!a.val())b(d.join(",")).on("keyup change focus",h)})}})(django.jQuery);