Refactor room addition logic; streamline new room creation and sorting in settings template for improved clarity and functionality

This commit is contained in:
Yaro Kasear 2025-06-20 12:49:55 -05:00
parent 3c9806bd34
commit 86a4e4d22f
2 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,3 @@
console.log('ComboBoxWidget loaded');
const ComboBoxWidget = (() => { const ComboBoxWidget = (() => {
let tempIdCounter = -1; let tempIdCounter = -1;

View file

@ -139,8 +139,10 @@
if (name.trim()) { if (name.trim()) {
const newRoom = ComboBoxWidget.createOption(`${name}`, null); const newRoom = ComboBoxWidget.createOption(`${name}`, null);
document.getElementById('room-list').appendChild(newRoom); const selectWidget = document.getElementById('room-list');
ComboBoxWidget.sortOptions(document.getElementById('room-list'));
selectWidget.appendChild(newRoom);
ComboBoxWidget.sortOptions(selectWidget);
bootstrap.Modal.getInstance(modal).hide(); bootstrap.Modal.getInstance(modal).hide();
} else { } else {
alert('Please enter a room name.'); alert('Please enter a room name.');