Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
Fixed theme name not showing up when editing an instance
  • Loading branch information
amanharwara committed Mar 6, 2019
1 parent 0515f5a commit bfd7b25
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/windows/main/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ let themes = new Store({
name: 'themes'
});

$('.dropdown').dropdown();
$('.dropdown').dropdown({
values: generateThemeNames()
});

function loadTabsFromStorage() {

let storedTabs = tabs.get('instances');
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit bfd7b25

Please sign in to comment.