Skip to content

Commit

Permalink
Update select element ID in General.cshtml
Browse files Browse the repository at this point in the history
Changed the ID of the select element from `ViewModel_SelectedThemeId` to `ViewModel_ThemeId` in two sections of `General.cshtml`. This ensures the correct element is targeted when adding or removing theme options.
  • Loading branch information
EdiWang committed Nov 7, 2024
1 parent 7b68930 commit 98c1adc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Moonglade.Web/Pages/Settings/General.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
themeModal.hide();
var selectElement = document.getElementById('ViewModel_SelectedThemeId');
var selectElement = document.getElementById('ViewModel_ThemeId');
var newOption = new Option(document.querySelector('#Name').value, id);
selectElement.appendChild(newOption);
Expand All @@ -90,7 +90,7 @@
'DELETE',
{},
(resp) => {
var selectElement = document.getElementById('ViewModel_SelectedThemeId');
var selectElement = document.getElementById('ViewModel_ThemeId');
var optionToRemove = selectElement.querySelector(`option[value='${selectedThemeId}']`);
if (optionToRemove) {
selectElement.removeChild(optionToRemove);
Expand Down

0 comments on commit 98c1adc

Please sign in to comment.