Spaces:
Running
Running
Update scripts/ui.js
Browse files- scripts/ui.js +7 -14
scripts/ui.js
CHANGED
@@ -1,25 +1,18 @@
|
|
1 |
// scripts/ui.js
|
2 |
|
3 |
-
const getElement = (id) => document.getElementById(id);
|
4 |
-
|
5 |
-
function loadRecommendations() {
|
6 |
-
const container = getElement('recommendations-container');
|
7 |
-
// The error happened here. Now the container should be found.
|
8 |
-
if (container) {
|
9 |
-
container.innerHTML = '<p>Recommendations will appear here soon...</p>';
|
10 |
-
}
|
11 |
-
}
|
12 |
-
|
13 |
export function initUI() {
|
14 |
-
|
15 |
-
const productionPanel = getElement('production-panel');
|
16 |
|
17 |
-
|
18 |
-
|
19 |
|
20 |
if (productionButton && productionPanel) {
|
|
|
21 |
productionButton.addEventListener('click', () => {
|
|
|
22 |
productionPanel.classList.toggle('open');
|
23 |
});
|
|
|
|
|
24 |
}
|
25 |
}
|
|
|
1 |
// scripts/ui.js
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
export function initUI() {
|
4 |
+
alert("Step 3: initUI() is running..."); // <-- DEBUG ALERT
|
|
|
5 |
|
6 |
+
const productionButton = document.getElementById('production-button');
|
7 |
+
const productionPanel = document.getElementById('production-panel');
|
8 |
|
9 |
if (productionButton && productionPanel) {
|
10 |
+
alert("Step 4: Found video button and panel. Adding click listener..."); // <-- DEBUG ALERT
|
11 |
productionButton.addEventListener('click', () => {
|
12 |
+
alert("Step 5: Video button CLICKED!"); // <-- DEBUG ALERT
|
13 |
productionPanel.classList.toggle('open');
|
14 |
});
|
15 |
+
} else {
|
16 |
+
alert("ERROR: Could NOT find the video button or panel in the HTML!"); // <-- DEBUG ALERT
|
17 |
}
|
18 |
}
|