SkirdaElectronLauncher/app/assets/js/scripts/settings.js
Daniel Scalzi 2dcbb45bdb
Further progress on settings UI.
Added a tooltip to the settings button on the landing UI.
Settings button now opens to the (incomplete) settings UI.
Added navigation bar to the settings UI.
Implemented tabbing between settings tabs.
More to come.
2018-05-30 16:00:07 -04:00

25 lines
832 B
JavaScript

let selectedTab = 'settingsTabAccount'
function setupSettingsTabs(){
Array.from(document.getElementsByClassName('settingsNavItem')).map((val) => {
val.onclick = (e) => {
if(val.hasAttribute('selected')){
return
}
const navItems = document.getElementsByClassName('settingsNavItem')
for(let i=0; i<navItems.length; i++){
if(navItems[i].hasAttribute('selected')){
navItems[i].removeAttribute('selected')
}
}
val.setAttribute('selected', '')
let prevTab = selectedTab
selectedTab = val.getAttribute('rSc')
$(`#${prevTab}`).fadeOut(250, () => {
$(`#${selectedTab}`).fadeIn(250)
})
}
})
}
setupSettingsTabs()