MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / _attachEarlyButtonHandlers

Function _attachEarlyButtonHandlers

renderer.js:39–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37
38// Scan STL Home + AI Config Test: delegated click handlers (Server/Docker - main block may run late)
39function _attachEarlyButtonHandlers() {
40 if (!document.body || document.body._earlyButtonHandlersAttached) return;
41 document.body._earlyButtonHandlersAttached = true;
42 document.body.addEventListener('click', function _earlyDelegated(e) {
43 if (!e.target || !e.target.closest) return;
44 if (e.target.closest('#scan-stl-home-button')) {
45 var btn = document.getElementById('scan-stl-home-button');
46 if (btn && btn.style.display === 'none') return;
47 e.preventDefault();
48 e.stopPropagation();
49 if (typeof window.runScanSTLHome === 'function') window.runScanSTLHome();
50 else window._pendingScanStlHome = true;
51 return;
52 }
53 if (e.target.closest('#test-ai-config')) {
54 e.preventDefault();
55 e.stopPropagation();
56 if (typeof window.testAIConfigFromDialog === 'function') window.testAIConfigFromDialog();
57 return;
58 }
59 });
60}
61if (document.readyState === 'loading') {
62 document.addEventListener('DOMContentLoaded', _attachEarlyButtonHandlers);
63} else {

Callers 1

renderer.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected