From e0088da2881821f82f5782120c621bf7aebda36b Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 11 Jun 2011 14:20:36 +0200 Subject: [PATCH] Only removes locality text field if we display a locality list. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- htdocs/javascript/search.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/javascript/search.js b/htdocs/javascript/search.js index 6ad9c4a..e544410 100644 --- a/htdocs/javascript/search.js +++ b/htdocs/javascript/search.js @@ -224,15 +224,14 @@ function setAddress(i, j, values) var next_type = address_types[j]; var next_list = next_type + '_list'; - if (j == 3) { - $('tr#locality_text').hide() - $("select[name='locality_text']").attr('value', ''); - } - $('#' + next_list).load(baseurl + 'list/' + next_type, { previous:prev_type, value:values[i] }, function() { if ($("select[name='" + next_type + "']").children("option").size() > 1) { $("tr#" + next_type).show(); $("select[name='" + next_type + "']").attr('value', values[j]); + if (next_type == 'locality') { + $('tr#locality_text').hide(); + $("select[name='locality_text']").attr('value', ''); + } if (j < address_types_count) { setAddress(j, j + 1, values); } -- 2.1.4