scripts/aiv_ui.js
/**
     * @function showReferenceChkboxes - add event listener to a pseudo element (an anchor for relative positioning) to show the 'hidden checkboxes'
     */
@function showReferenceChkboxes - add event listener to a pseudo element (an anchor for relative positioning) to show the 'hidden checkboxes'
@function showReferenceChkboxes - add event listener to a pseudo element ( an anchor for relative positioning ) to show the ' hidden checkboxes '
function showReferenceChkboxes() {
        let expanded = false;
        let checkboxes = $("#refCheckboxes");
        document.getElementById('pseudo-select-box').addEventListener('click', function(e){
            if (!document.getElementById('filterEPPIsCheckbox').checked){
                return; 
            }
            if (!expanded) {
                checkboxes.css('display', 'block');
                expanded = true;
            }
            else {
                checkboxes.css('display', 'none');
                expanded = false;
            }
            if (window.getSelection) {window.getSelection().removeAllRanges();}
            else if (document.selection) {document.selection.empty();}
        });
        document.addEventListener('click', function(e){ 
            let multiSelectDiv = $("#multi-select");
            if (!multiSelectDiv.is(e.target) && multiSelectDiv.has(e.target).length === 0) {
                checkboxes.css('display', 'none');
                expanded = false;
            }
        });
    }
function showReferenceChkboxes ( ) { let expanded = false ; let checkboxes = $ ( "#refCheckboxes" ) ; document . getElementById ( 'pseudo-select-box' ) . addEventListener ( 'click' , function ( e ) { if ( ! document . getElementById ( 'filterEPPIsCheckbox' ) . checked ) { return ; } if ( ! expanded ) { checkboxes . css ( 'display' , 'block' ) ; expanded = true ; } else { checkboxes . css ( 'display' , 'none' ) ; expanded = false ; } if ( window . getSelection ) { window . getSelection ( ) . removeAllRanges ( ) ; } else if ( document . selection ) { document . selection . empty ( ) ; } } ) ; document . addEventListener ( 'click' , function ( e ) { let multiSelectDiv = $ ( "#multi-select" ) ; if ( ! multiSelectDiv . is ( e . target ) && multiSelectDiv . has ( e . target ) . length === 0 ) { checkboxes . css ( 'display' , 'none' ) ; expanded = false ; } } ) ; }
@function showReferenceChkboxes - add event listener to a pseudo element (an anchor for relative positioning) to show the 'hidden checkboxes'
@function showReferenceChkboxes - add event listener to a pseudo element ( an anchor for relative positioning ) to show the ' hidden checkboxes '
// exit immediately if user doesnt have filter on // Below is a 'hack' to remove the text selection that seldom happens with this multi select hack :P //event listener to handle clicks outside of dropdown // if the target of the click isn't the container nor a descendant of the container