-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
30 lines (23 loc) · 1013 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import setupProjectSelector from "./src/utils/setupProjectSelector.js";
window.onload = async function () {
var product = "rtc"
setupProjectSelector(product);
// Store the select element in a variable
const selectProductElement = document.getElementById('selectProduct');
// Function to update and pass the config
function updateAndPassConfig(selectedValue) {
// Select a product based on the selected value
product = (selectedValue === "ILS") ? "live" : "rtc";
// Pass the updated config to setupProjectSelector or any other function as needed
setupProjectSelector(product);
// Do something with the selected value
console.log('Selected Product:', selectedValue);
}
// Add an event listener for the 'change' event
selectProductElement.addEventListener('change', function() {
// Get the selected value
const selectedValue = selectProductElement.value;
// Call the function to update and pass the config
updateAndPassConfig(selectedValue);
});
};