X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fjavascript%2Fprofile.js;h=4c7d01f937a7517024dcb2483c9250e2546ac907;hb=e8637579497c3bc432c0cff30241d508fa465672;hp=5c255804a7895eb3289c9831c7ad76600043cc12;hpb=53ee429b076f679168fda0301651a21b00ddf0e3;p=platal.git diff --git a/htdocs/javascript/profile.js b/htdocs/javascript/profile.js index 5c25580..4c7d01f 100644 --- a/htdocs/javascript/profile.js +++ b/htdocs/javascript/profile.js @@ -47,6 +47,7 @@ function wizPage_onLoad(id) updateJobSecteur(i, 'job_' + i, 'jobs[' + i + ']', document.forms.prof_annu["jobs[" + i + "][ss_secteur]"].value); } + registerEnterpriseAutocomplete(-1); break; } } @@ -350,6 +351,7 @@ function makeAddJob(id) return function(data) { $('#add_job').before(data); + registerEnterpriseAutocomplete(id); updateSecteur('job_' + id, 'jobs[' + id + ']', ''); }; } @@ -494,4 +496,21 @@ function removeSecteur(s, ss) updateSSecteur(); } +function registerEnterpriseAutocomplete(id) +{ + $(".enterprise_name").each( + function() { + if (id == -1 || this.name == "jobs[" + id + "][name]") { + $(this).autocomplete(platal_baseurl + "search/autocomplete/entreprise", + { + selectOnly:1, + field:this.name, + matchSubset:0, + width:$(this).width() + }); + } + } + ); +} + // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: