fix(archive): point getElementById at the real root id

drag-drop.js and the unsupported-browser handler in app.js both
referenced getElementById('app'), but the template's root has
id="appContainer". The mismatch was masked in production because
sourceMode='http' skips dragDrop.init() — only file:// (sourceMode=
'local') tripped over it, throwing "Cannot read properties of null
(reading 'addEventListener')" at app load.

Surfaced while header-standardizing the other tools; fixed by
pointing both callers at #appContainer.
This commit is contained in:
ZDDC 2026-05-03 22:21:51 -05:00
parent bbb75a87af
commit e67c1b2e06
2 changed files with 5 additions and 3 deletions

View file

@ -300,7 +300,7 @@
// Show unsupported browser message
function showUnsupportedBrowserMessage() {
const app = document.getElementById('app');
const app = document.getElementById('appContainer');
app.innerHTML = `
<div class="empty-state">
<div class="empty-state-content">

View file

@ -24,8 +24,10 @@
// Handle drops on grouping folders (for creating transmittals)
document.getElementById('groupingFoldersList').addEventListener('drop', handleDrop, false);
// Handle drops on the main app area (for adding directories)
document.getElementById('app').addEventListener('drop', handleAppDrop, false);
// Handle drops on the main app area (for adding directories).
// Note: the root element is id="appContainer" (id="app" was a
// stale reference that crashed dragDrop init in local mode).
document.getElementById('appContainer').addEventListener('drop', handleAppDrop, false);
}
// Prevent default behaviors