X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=htdocs%2Fjavascript%2Fprofile.js;h=4c7d01f937a7517024dcb2483c9250e2546ac907;hb=269154e29e93e01807a8f20ce08a0dec698b53c9;hp=d59a36515c8f25c127c65d3d346b2df934dce221;hpb=d0327f6de73e81c4bcc656471ca4161e4f1e1e1b;p=platal.git diff --git a/htdocs/javascript/profile.js b/htdocs/javascript/profile.js index d59a365..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 + ']', ''); }; } @@ -405,7 +407,7 @@ function updateCountry() { var val = document.forms.prof_annu.countries_sel.value; var show = true; - if (val == '') { + if (val == '' || val == '00') { show = false; } if (document.getElementById('countries_' + val) != null) { @@ -420,11 +422,11 @@ function addCountry() var val = cb.value; var text = cb.options[cb.selectedIndex].text; var html = '
' - + '
' + text + '
' - + ' ' - + ' ' + + ' ' + ' ' + ' ' + + '
' + text + '
' + + ' ' + '
'; $('#countries').append(html); updateCountry(); @@ -454,6 +456,8 @@ function updateSecteur() var secteur = document.forms.prof_annu.secteur_sel.value; if (secteur == '') { secteur = '-1'; + document.getElementById('ss_secteur_sel').innerHTML = ''; + return; } $.get(platal_baseurl + 'profile/ajax/secteur/-1/' + secteur, function(data) { @@ -492,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: