<commit_before>
//https://github.com/ninsuo/symfony-collection/issues/47

 $('.mis_participantes').collection({
            //prototype_name: '{{ form.participantes.vars.prototype.vars.name }}',
            //name_prefix: '{{ form.participantes.vars.full_name }}',
            allow_add: true,
            'add': '<a href="#" class="btn-sm btn-default collection-add" title="añadir Participante"><span class="glyphicon glyphicon-plus-sign"></span></a>',
            allow_remove: true,
            //'remove': '<a href="#" class="btn-sm btn-default collection-remove" title="quitar Participante"><span class="glyphicon glyphicon-trash"></span></a>',
            allow_down: false,
            allow_up: false,
            //custom_add_location: true,
            add_at_the_end: true,
            allow_duplicate: false,
            min: 3,
            hide_useless_buttons: true,
            drag_drop: false,
            position_field_selector: '.my-position',
            before_remove: function(collection, element) 
            { 
                var hijosPuros=collection["0"].childElementCount;<commit_msg>conseguido retirar los iconos basura exceopto el ultimo si no se borra<commit_after>
//https://github.com/ninsuo/symfony-collection/issues/47

 $('.mis_participantes').collection({
            //prototype_name: '{{ form.participantes.vars.prototype.vars.name }}',
            //name_prefix: '{{ form.participantes.vars.full_name }}',
            allow_add: true,
            'add': '<a href="#" class="btn-sm btn-default collection-add" title="añadir Participante"><span class="glyphicon glyphicon-plus-sign"></span></a>',
            allow_remove: true,
            //'remove': '<a href="#" class="btn-sm btn-default collection-remove" title="quitar Participante"><span class="glyphicon glyphicon-trash"></span></a>',
            allow_down: false,
            allow_up: false,
            //custom_add_location: true,
            add_at_the_end: true,
            allow_duplicate: false,
            min: 3,
            hide_useless_buttons: true,
            drag_drop: false,
            position_field_selector: '.my-position',
            after_add:function(collection, element) {
                  var hijosPuros=collection["0"].childElementCount;
                  var indiceUltima=hijosPuros-3;
                  console.log(collection);
                  console.log("desplegados los trash");
                  // if(indiceUltima>3)
                  // {
                  /*
                  var iconoTrash1=collection["0"].childNodes["0"].childNodes["0"].childNodes[2].children["0"].children;      
                  var padreIconoTrash1=collection["0"].childNodes["0"].childNodes["0"].childNodes[2].children;

                  //console.log(iconoTrash1);
                  //console.log(padreIconoTrash1);
                  var spans=document.getElementsByTagName("span");
                  //console.log(spans);
                  */
                  var trashs=document.getElementsByClassName("glyphicon-trash");
                  console.log(trashs); 
                  console.log(trashs[0]); 
                  basura=trashs[0];
                  basura.parentNode.removeChild(basura);
            
                  //console.log(iconoTrash1);
                  //padreIconoTrash1.removeChild();
                  // }            
                 
             },
            before_remove: function(collection, element) 
            { 
                var hijosPuros=collection["0"].childElementCount;
{'fraction_non_alphanumeric': 0.13308844306301215, 'fraction_numerical': 0.007911839502684374, 'mean_word_length': 1.9087921117502054, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 20, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5697728', 'n_tokens_mistral': 1005, 'n_tokens_neox': 953, 'n_words': 146}