From ed405a22f7beca3138d0d3f1a22b8eedd0bd2487 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 1 Nov 2010 23:17:05 +0100 Subject: [PATCH] Displays degree on profile edition even if university is missing. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- htdocs/javascript/profile.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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); } -- 2.1.4