← Commit history

Clear previous cooling concept when switching the comparison viewer

John Lauer ·5e2aa38722 · ·parent 465f160
1 file changed +1−1
docs/cooling-3d/viewer.html+1−1
@@ -3,7 +3,7 @@ const status=document.getElementById('status'),choice=document.getElementById('c try{ await import('/static/vendor/adom-3d-viewer-babylon9/adom-3d-viewer-babylon9.esm.js?v=20261012b'); const v=window.Adom3DViewerBabylon9.init(document.getElementById('host'),{zUp:true,showViewCube:true});window.coolingViewer=v;-window.selectCooling=async function(id){choice.value=id;choice.disabled=true;status.textContent='Loading '+id+'…';await v.loadModel('https://wiki.adom.inc/adom/adom-custom-electronic-load/render/docs/cooling-3d/'+id+'.glb');v.frameModel();document.getElementById('cooling').checked=true;choice.disabled=false;status.textContent='Ready — drag to orbit; hide cooler to inspect Q1. Thermal results are conditional estimates.';return {id,meshes:v.getScene().meshes.length};};+window.selectCooling=async function(id){choice.value=id;choice.disabled=true;status.textContent='Loading '+id+'…';v.clearScene();await v.loadModel('https://wiki.adom.inc/adom/adom-custom-electronic-load/render/docs/cooling-3d/'+id+'.glb');v.frameModel();document.getElementById('cooling').checked=true;choice.disabled=false;status.textContent='Ready — drag to orbit; hide cooler to inspect Q1. Thermal results are conditional estimates.';return {id,meshes:v.getScene().meshes.length};}; choice.onchange=()=>selectCooling(choice.value);document.getElementById('home').onclick=()=>v.goHome();document.getElementById('cooling').onchange=e=>{for(const m of v.getScene().meshes)if(m.name.includes('Cooling'))m.setEnabled(e.target.checked);}; await selectCooling('preferred50'); }catch(e){status.textContent='Viewer error: '+e.message;window.viewerError=e.message;}