scripts/aiv_ui.js
/**
     * @function mapManDropDown -
     * @param {object} AIVObj - reference to global namespace AIV object, with access to cytoscape methods
     */
@function mapManDropDown
@param {object} AIVObj - reference to global namespace AIV object, with access to cytoscape methods
@function mapManDropDown @param { object } AIVObj - reference to global namespace AIV object with access to cytoscape methods
function mapManDropDown(AIVObj){
        $('#mmDropdown').on({ 
            "shown.bs.dropdown": function() { this.closable = false; },
            "click":             function() { this.closable = true; },
            "hide.bs.dropdown":  function() { return this.closable; }
        });
        $('#bootstrapDropDownMM a').on( 'click', function( event ) {
            let inputChild = $(event.target).children("input");
            inputChild.prop('checked', !inputChild.is(':checked'));
            hideMapManNodes($(event.target).data("value"));
            return false;
        });
        function hideMapManNodes(mapManNum){
            console.log(mapManNum);
            AIVObj.cy.startBatch();
            AIVObj.cy.$(`node[mapManOverlay = '${mapManNum}'][id ^= "Protein"]`).toggleClass('hideMapManNodes');
            AIVObj.cy.endBatch();
        };
    }
function mapManDropDown ( AIVObj ) { $ ( '#mmDropdown' ) . on ( { "shown.bs.dropdown" : function ( ) { this . closable = false ; } , "click" : function ( ) { this . closable = true ; } , "hide.bs.dropdown" : function ( ) { return this . closable ; } } ) ; $ ( '#bootstrapDropDownMM a' ) . on ( 'click' , function ( event ) { let inputChild = $ ( event . target ) . children ( "input" ) ; inputChild . prop ( 'checked' , ! inputChild . is ( ':checked' ) ) ; hideMapManNodes ( $ ( event . target ) . data ( "value" ) ) ; return false ; } ) ; function hideMapManNodes ( mapManNum ) { console . log ( mapManNum ) ; AIVObj . cy . startBatch ( ) ; AIVObj . cy . $ ( ` ${ mapManNum } ` ) . toggleClass ( 'hideMapManNodes' ) ; AIVObj . cy . endBatch ( ) ; } ; }
@function mapManDropDown
 @param {object} AIVObj - reference to global namespace AIV object, with access to cytoscape methods
@function mapManDropDown @param { object } AIVObj - reference to global namespace AIV object with access to cytoscape methods
//hack to prohibit the dropdown from closing when you click outside, credits to https://stackoverflow.com/questions/19740121/keep-bootstrap-dropdown-open-when-clicked-off/19797577#19797577