diff --git a/src/windows/main/js/main.js b/src/windows/main/js/main.js index 9996db47..8b73182c 100644 --- a/src/windows/main/js/main.js +++ b/src/windows/main/js/main.js @@ -28,6 +28,11 @@ let themes = new Store({ name: 'themes' }); +$('.dropdown').dropdown(); +$('.dropdown').dropdown({ + values: generateThemeNames() +}); + function loadTabsFromStorage() { let storedTabs = tabs.get('instances'); @@ -89,6 +94,7 @@ $('.ui.modal') tabs.set('instances', tabsStore); addNewInstance(newInstance); + checkForInstances(); $('.tab-element.active').removeClass('active'); $(`#tab-${newInstance.id}`).addClass('active'); $(`#tab-${newInstance.id}`).click(); @@ -125,11 +131,6 @@ function generateThemeNames() { return nameList; } -$('.dropdown').dropdown(); -$('.dropdown').dropdown({ - values: generateThemeNames() -}); - function generateThemeCSS(name) { let themesList = themes.get('themes'); let selectedTheme = themesList.find(x => x.name === name); @@ -299,6 +300,9 @@ function addNewInstance(instance) { values: generateThemeNames() }); + $(`.${tab.id}-theme-value`).dropdown('set selected', tab.settings.theme); + $(`.${tab.id}-theme-value`).dropdown(); + setWebViewSettingsLoop(); }