openjaf/cenit

View on GitHub
public/assets/devise-a3ac59f99950234f6b585f77da727a612629225f4e17d2f4293d3884c16dd261.js

Summary

Maintainability
C
7 hrs
Test Coverage
(function () {
    Array.from(
        document.getElementsByClassName('responsive-box')
    ).forEach(
        rbox => Array.from(rbox.getElementsByClassName('devise box')).forEach(
            dbox => window.App.addResizeListener(() => {
                const rect = dbox.getBoundingClientRect();
                const vh = Math.max(
                    document.documentElement.clientHeight || 0, window.innerHeight || 0
                );
                if (rect.height > vh) {
                    rbox.classList.remove('centered');
                } else {
                    rbox.classList.add('centered');
                }
            })
        )
    )
})();