scripts/aiv_ui.js
/**
     * @function filterAllElistener - filter all of the references by clicking through all the checked checkboxes if checked, if #allCheck is unchecked, recheck all references
     * @description - note that I decided NOT to click through all the checkboxes as that would be much slower and user-unfriendly; the cost is that I am taking the risk that all of the checkboxes filtered are pubmeds/dois/AI-1
     */
@function filterAllElistener - filter all of the references by clicking through all the checked checkboxes if checked, if #allCheck is unchecked, recheck all references
@description - note that I decided NOT to click through all the checkboxes as that would be much slower and user-unfriendly; the cost is that I am taking the risk that all of the checkboxes filtered are pubmeds/dois/AI-1
@function filterAllElistener - filter all of the references by clicking through all the checked checkboxes if checked if #allCheck is unchecked recheck all references @description - note that I decided NOT to click through all the checkboxes as that would be much slower and user - unfriendly ; the cost is that I am taking the risk that all of the checkboxes filtered are pubmeds / dois / AI - 1
function filterAllElistener(AIVObj){
        document.getElementById('allCheck').addEventListener('click',function(event){
            if (event.target.checked) {
                let nodeListChkdCheckboxes = document.querySelectorAll('input:checked.ref-checkbox');
                AIVObj.cy.edges('[reference *= "pubmed"], [reference *= "doi"], [reference *= "AI-1"]').addClass('filterByReference');
                if (nodeListChkdCheckboxes.length > 0) { 
                    [].forEach.call(nodeListChkdCheckboxes, function(node){
                        node.checked = false;
                    });
                }
            }
            else {
                let nodeListUnchkdCheckboxes = document.querySelectorAll('input:not(:checked).ref-checkbox');
                if (nodeListUnchkdCheckboxes.length > 0) { 
                    AIVObj.cy.$('.filterByReference').removeClass('filterByReference');
                    [].forEach.call(nodeListUnchkdCheckboxes, function(node){
                        node.checked = true;
                    });
                }
            }
        });
    }
function filterAllElistener ( AIVObj ) { document . getElementById ( 'allCheck' ) . addEventListener ( 'click' , function ( event ) { if ( event . target . checked ) { let nodeListChkdCheckboxes = document . querySelectorAll ( 'input:checked.ref-checkbox' ) ; AIVObj . cy . edges ( '[reference *= "pubmed"], [reference *= "doi"], [reference *= "AI-1"]' ) . addClass ( 'filterByReference' ) ; if ( nodeListChkdCheckboxes . length > 0 ) { [ ] . forEach . call ( nodeListChkdCheckboxes , function ( node ) { node . checked = false ; } ) ; } } else { let nodeListUnchkdCheckboxes = document . querySelectorAll ( 'input:not(:checked).ref-checkbox' ) ; if ( nodeListUnchkdCheckboxes . length > 0 ) { AIVObj . cy . $ ( '.filterByReference' ) . removeClass ( 'filterByReference' ) ; [ ] . forEach . call ( nodeListUnchkdCheckboxes , function ( node ) { node . checked = true ; } ) ; } } } ) ; }
@function filterAllElistener - filter all of the references by clicking through all the checked checkboxes if checked, if #allCheck is unchecked, recheck all references
 @description - note that I decided NOT to click through all the checkboxes as that would be much slower and user-unfriendly; the cost is that I am taking the risk that all of the checkboxes filtered are pubmeds/dois/AI-1
@function filterAllElistener - filter all of the references by clicking through all the checked checkboxes if checked if #allCheck is unchecked recheck all references @description - note that I decided NOT to click through all the checkboxes as that would be much slower and user - unfriendly ; the cost is that I am taking the risk that all of the checkboxes filtered are pubmeds / dois / AI - 1
//reset form checkboxes //reset form checkboxes