dist/js/glightbox.js
function getClosest(elem, selector) {
        while (elem !== document.body) {
            elem = elem.parentElement;
            var matches = typeof elem.matches == 'function' ? elem.matches(selector) : elem.msMatchesSelector(selector);

            if (matches) return elem;
        }
    }
function getClosest(elem, selector) {
        while (elem !== document.body) {
            elem = elem.parentElement;
            var matches = typeof elem.matches == 'function' ? elem.matches(selector) : elem.msMatchesSelector(selector);

            if (matches) return elem;
        }
    }
function getClosest ( elem , selector ) { while ( elem !== document . body ) { elem = elem . parentElement ; var matches = typeof elem . matches == 'function' ? elem . matches ( selector ) : elem . msMatchesSelector ( selector ) ; if ( matches ) return elem ; } }
Get the closestElement

@param {node} element
@param {string} class name
Get the closestElement