Correction javascript sur les emails

This commit is contained in:
Michael RICOIS 2011-11-22 09:23:48 +00:00
parent ab80c61fa3
commit 72ef6f78d9

View File

@ -115,7 +115,7 @@ $(document).ready(function(){
var concat = ''; var concat = '';
var liste = txt.split(';'); var liste = txt.split(';');
for (item in liste){ for (item in liste){
concat = concat+liste[item]+' <a href="#" class="deleteIP" id="'+liste[item]+'">Supp</a><br/>'; concat = concat+liste[item]+' [<a href="#" class="deleteIP" id="'+liste[item]+'">Suppression</a>]<br/>';
} }
$('input[name=filtres_ip]').val(txt); $('input[name=filtres_ip]').val(txt);
$('#listeip').html(concat); $('#listeip').html(concat);
@ -130,16 +130,18 @@ $(document).ready(function(){
return false; return false;
}); });
$('.deleteIP').on('click', function(e){ $('body').delegate('.deleteIP', 'click', function(e){
e.preventDefault(); e.preventDefault();
var select = $(this).attr('id'); var select = $(this).attr('id');
var txt = ''; var txt = '';
var concat = ''; var concat = '';
var liste = $('input[name=filtres_ip]').val().split(';'); var strListe = $('input[name=filtres_ip]').val();
strListe = strListe.substring(0, strListe.length-1);
var liste = strListe.split(';');
for (item in liste){ for (item in liste){
if (liste[item]!=select){ if (liste[item]!=select){
(txt.length>0) ? txt = txt+';'+liste[item] : txt = liste[item]; (txt.length>0) ? txt = txt+';'+liste[item] : txt = liste[item];
concat = concat+liste[item]+' <a href="#" class="deleteIP" id="'+liste[item]+'">Supp</a><br/>'; concat = concat+liste[item]+' [<a href="#" class="deleteIP" id="'+liste[item]+'">Suppression</a>]<br/>';
} }
} }
$('input[name=filtres_ip]').val(txt); $('input[name=filtres_ip]').val(txt);