toggleModal(target, show) {
        if (show) {
            const modalId = target.getAttribute('href').replace('#', '');
            document.body.classList.add('modal-open');
            document.getElementById(modalId).style.display = 'block';

            const targetTab = target.dataset.targetTab;
            if (targetTab) {
                const navTab = document.querySelector('ul.nav-tabs > li > a[href="' + targetTab + '"]');
                if (navTab) {
                    wcmsAdminActions.openTabAction(navTab);
                }
            }
            return;
        }

        document.body.classList.remove('modal-open');
        if (target.dataset && target.dataset.dismiss) {
            target.closest('.wcms-modal').style.display = 'none';
            return;
        }

        // close all modals
        [].forEach.call(document.getElementsByClassName('wcms-modal'), function (el) {
            el.style.display = 'none';
        });
    }
/**
     * Toggle modal based on clicked element
     * @param target
     * @param show
     */
Toggle modal based on clicked element
@param target
@param show
Toggle modal based on clicked element @param target @param show
toggleModal(target, show) {
        if (show) {
            const modalId = target.getAttribute('href').replace('#', '');
            document.body.classList.add('modal-open');
            document.getElementById(modalId).style.display = 'block';
            const targetTab = target.dataset.targetTab;
            if (targetTab) {
                const navTab = document.querySelector('ul.nav-tabs > li > a[href="' + targetTab + '"]');
                if (navTab) {
                    wcmsAdminActions.openTabAction(navTab);
                }
            }
            return;
        }
        document.body.classList.remove('modal-open');
        if (target.dataset && target.dataset.dismiss) {
            target.closest('.wcms-modal').style.display = 'none';
            return;
        }
        [].forEach.call(document.getElementsByClassName('wcms-modal'), function (el) {
            el.style.display = 'none';
        });
    }
toggleModal ( target , show ) { if ( show ) { const modalId = target . getAttribute ( 'href' ) . replace ( '#' , '' ) ; document . body . classList . add ( 'modal-open' ) ; document . getElementById ( modalId ) . style . display = 'block' ; const targetTab = target . dataset . targetTab ; if ( targetTab ) { const navTab = document . querySelector ( 'ul.nav-tabs > li > a[href="' + targetTab + '"]' ) ; if ( navTab ) { wcmsAdminActions . openTabAction ( navTab ) ; } } return ; } document . body . classList . remove ( 'modal-open' ) ; if ( target . dataset && target . dataset . dismiss ) { target . closest ( '.wcms-modal' ) . style . display = 'none' ; return ; } [ ] . forEach . call ( document . getElementsByClassName ( 'wcms-modal' ) , function ( el ) { el . style . display = 'none' ; } ) ; }
Toggle modal based on clicked element
 @param target
 @param show
Toggle modal based on clicked element @param target @param show
// close all modals