From: Stéphane Jacob Date: Mon, 1 Nov 2010 22:17:05 +0000 (+0100) Subject: Displays degree on profile edition even if university is missing. X-Git-Tag: xorg/1.0.2~166 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=ed405a22f7beca3138d0d3f1a22b8eedd0bd2487;p=platal.git Displays degree on profile edition even if university is missing. Signed-off-by: Stéphane Jacob --- diff --git a/htdocs/javascript/profile.js b/htdocs/javascript/profile.js index ef2c7ef..7e6b683 100644 --- a/htdocs/javascript/profile.js +++ b/htdocs/javascript/profile.js @@ -161,7 +161,11 @@ function prepareType(id) var edu = $('.edu_' + id).find("[name='edus[" + id + "][eduid]']").val() - 1; var sel = $('.edu_' + id).find('[name=edu_' + id + '_tmp]').val(); var html = ''; - var length = educationDegree[edu].length; + if (educationDegree[edu]) { + var length = educationDegree[edu].length; + } else { + var length = 0; + } for (i = 0; i < length; ++i) { html += ''; + } $('.edu_' + id).find("[name='edus[" + id + "][degreeid]']").html(html); }