mirror of
https://github.com/IrosTheBeggar/mStream.git
synced 2025-10-27 07:31:02 +00:00
39 lines
785 B
JavaScript
39 lines
785 B
JavaScript
const app = Vue.createApp({
|
|
data() { return {
|
|
currentViewMain: 'file-explorer-view'
|
|
}},
|
|
methods: {
|
|
toggleMenu(event) {
|
|
toggleSideMenu();
|
|
}
|
|
}
|
|
})
|
|
|
|
const fileExplorerView = app.component('file-explorer-view', {
|
|
template: `<div>FILE EXPLORER</div>`
|
|
});
|
|
|
|
const nowPlayingView = app.component('now-playing-view', {
|
|
template: `<div>CURRENTLY PLAYING</div>`
|
|
});
|
|
|
|
const vm = app.mount('#content');
|
|
|
|
function changeView(viewName, el){
|
|
if (vm.currentViewMain === viewName) {
|
|
closeSideMenu();
|
|
return;
|
|
}
|
|
|
|
vm.currentViewMain = viewName;
|
|
|
|
const elements = document.querySelectorAll('.side-nav-item'); // or:
|
|
elements.forEach(elm => {
|
|
elm.classList.remove("select")
|
|
});
|
|
|
|
el.classList.add("select");
|
|
|
|
// close nav on mobile
|
|
closeSideMenu();
|
|
} |