Enhance model constructors; add optional parameters for improved initialization across multiple modelsOh
This commit is contained in:
parent
acacf39f8e
commit
8162038f40
10 changed files with 90 additions and 13 deletions
|
@ -190,8 +190,12 @@ submit_button=True
|
|||
|
||||
saveButton.addEventListener('click', () => {
|
||||
const name = document.getElementById('roomName').value.trim();
|
||||
const section = document.getElementById('roomSection').value;
|
||||
const func = document.getElementById('roomFunction').value;
|
||||
const sectionVal = document.getElementById('roomSection').value;
|
||||
const funcVal = document.getElementById('roomFunction').value;
|
||||
|
||||
const section = sectionVal !== "" ? parseInt(sectionVal) : null;
|
||||
const func = funcVal !== "" ? parseInt(funcVal) : null;
|
||||
|
||||
|
||||
if (!name) {
|
||||
alert('Please enter a room name.');
|
||||
|
@ -208,6 +212,14 @@ submit_button=True
|
|||
|
||||
// Add to select box visibly
|
||||
const option = ComboBoxWidget.createOption(name);
|
||||
|
||||
if (section !== null) {
|
||||
option.dataset.sectionId = section;
|
||||
}
|
||||
if (func !== null) {
|
||||
option.dataset.functionId = func;
|
||||
}
|
||||
|
||||
roomList.appendChild(option);
|
||||
ComboBoxWidget.sortOptions(roomList);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue