HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/blije-gasten.komma.pro/resources/js/shop/kms/shopKms.js
/* ==========================================================================
   Browser Handler
 ========================================================================== */

const ShopKMSHandler = {

    init: function () {
        this.checkOrderCheckboxes();
    },


    checkOrderCheckboxes: function () {
        let batchCheckboxes = document.querySelectorAll('.js-batch-checkbox');
        let batchCheckboxesLength = batchCheckboxes.length;
        let batchEditControlPanel = document.querySelector('.batch_edit_controls');

        for(let i = 0; i < batchCheckboxesLength; i++) {
            batchCheckboxes[i].addEventListener('change', function (ev) {
                batchEditControlPanel.style.top = ev.currentTarget.parentElement.offsetTop + 'px';

                if(document.querySelectorAll('input.js-batch-checkbox:checked').length === 0){
                    batchEditControlPanel.style.top = "-1000px";
                }
            });
        }
    }

};

document.addEventListener("DOMContentLoaded", function() {
    ShopKMSHandler.init();
});