app/static/scripts/globalScripts.js
// returns a sibling icon element, to be used when adding sibling to a card
returns a sibling icon element, to be used when adding sibling to a card
returns a sibling icon element to be used when adding sibling to a card
sibling_icon() {
        if(this.hasCard == true) {
            return this.cardHolder
        }
        var sibling_icon = document.createElement('div');
        sibling_icon.className = 'sibling_icon';
        sibling_icon.id = this.id;
        var delete_icon = document.createElement('div');
        delete_icon.className = 'delete_sibling';
        delete_icon.innerText = 'X';
        delete_icon.addEventListener('click', function() { 
            var parent = this.parentElement;
            parent.remove();
            delete_person(parent.id);
        });
        var initials_array = [];
        var names_array = this.givenName.split(' ');
        names_array.forEach(function(word) {
            var first_letter = word.slice(0,1);
            initials_array.push(first_letter);
        });
        var join_string = initials_array.join('.');
        var last_period = '.';
        var initials = join_string.concat(last_period);
        sibling_icon.innerText = this.givenName;
        return sibling_icon
    }
sibling_icon ( ) { if ( this . hasCard == true ) { return this . cardHolder } var sibling_icon = document . createElement ( 'div' ) ; sibling_icon . className = 'sibling_icon' ; sibling_icon . id = this . id ; var delete_icon = document . createElement ( 'div' ) ; delete_icon . className = 'delete_sibling' ; delete_icon . innerText = 'X' ; delete_icon . addEventListener ( 'click' , function ( ) { var parent = this . parentElement ; parent . remove ( ) ; delete_person ( parent . id ) ; } ) ; var initials_array = [ ] ; var names_array = this . givenName . split ( ' ' ) ; names_array . forEach ( function ( word ) { var first_letter = word . slice ( 0 , 1 ) ; initials_array . push ( first_letter ) ; } ) ; var join_string = initials_array . join ( '.' ) ; var last_period = '.' ; var initials = join_string . concat ( last_period ) ; sibling_icon . innerText = this . givenName ; return sibling_icon }
returns a sibling icon element, to be used when adding sibling to a card
returns a sibling icon element to be used when adding sibling to a card
// search if existing first // point to existing //sibling_icon.innerText = initials; //sibling_icon.appendChild(delete_icon);