js/Calc_statment.js

Code: DEV-ADB7E191 Size: 1.3 KB Lines: 33 Path: /home/prodconfig.wenesthosting.com/dev.solargroup.wenest.se/js/Calc_statment.js

Task / Comment

Open report form
// Calc_statment.js — Kalkylsammanställning (ny sida, steg 1: bara rubrik)

function openCalcStatment(){
    // Göm ALLA andra page-content
    document.querySelectorAll('.page-content').forEach(function(p){
        if(p.id !== 'page-calc-statment'){
            p.classList.remove('active');
            p.style.display = 'none';
        }
    });
    // Göm kända inre vyer som kan leaka
    ['summaryProductList','kalkylListView','kalkylConfigView','newCalcRenderArea','newCalcShell','cfgCategoryBar','cfgCategoryGrid','affarView','solarConfigView','genericConfigView','fonsterConfigView','batteriConfigView','laddboxConfigView','taktvatConfigView','varmepumpConfigView','takConfigView','isoleringConfigView'].forEach(function(id){
        var el = document.getElementById(id);
        if(el) el.style.display = 'none';
    });
    var ra = document.getElementById('newCalcRenderArea');
    if(ra) ra.remove();

    var page = document.getElementById('page-calc-statment');
    if(page){
        page.classList.add('active');
        page.style.display = 'block';
    }
}

function closeCalcStatment(){
    var page = document.getElementById('page-calc-statment');
    if(page){ page.classList.remove('active'); page.style.display = 'none'; }
}

window.openCalcStatment = openCalcStatment;
window.closeCalcStatment = closeCalcStatment;