From ee0b820a3a8965b2750f0cb12cb9e1d0027e92d3 Mon Sep 17 00:00:00 2001 From: Aram HARUTYUNYAN Date: Thu, 1 Aug 2013 06:54:17 +0000 Subject: [PATCH] Issue #0001674: --- .../default/scripts/saisie/lienetranger.phtml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/application/views/default/scripts/saisie/lienetranger.phtml b/application/views/default/scripts/saisie/lienetranger.phtml index 134d337e0..e0f551bcc 100644 --- a/application/views/default/scripts/saisie/lienetranger.phtml +++ b/application/views/default/scripts/saisie/lienetranger.phtml @@ -248,10 +248,19 @@ $('div#blocIdLocal').on('click', 'a.addIdLocal', function(e){ e.preventDefault(); var country = $('select[name=adresse_pays]').val(); AddSelectCountry(country, $(this).attr('href')); + $('.addIdLocal').hide(); + $('.removeIdLocal').hide(); +}); +$('div#blocIdLocal').on('click', 'a.removeIdLocal', function(e){ + e.preventDefault(); + var prevId = $(this).attr('href')-1; + $('a#ad'+prevId).show(); + $('a#rm'+prevId).show(); + $(this).parent().parent().remove(); }); function AddSelectCountry(code, n){ - if (!n) { n=1; } + if (!n) { n=1; } else {n++;} if (n<=3){ var html = 'Aucun identifiant !'; $.getJSON('/saisie/countryid', {code: code}, function(data){ @@ -261,8 +270,10 @@ function AddSelectCountry(code, n){ }); if (option!=''){ html = '
'+ - '
'+ - '[+]
'; + '
'+ + ''; + if (n<3) { html = html+'[+]';} + html = html+'[-]
'; } $('div#blocIdLocal').append(html); });