mirror of
https://github.com/manilarome/the-glorious-startpage.git
synced 2024-11-24 00:23:39 +01:00
fix my main fucking problem, the hiding/showing of screens
This commit is contained in:
parent
c041a059ac
commit
fdd1f0296f
@ -24,16 +24,41 @@ const hideDashboard = () => {
|
||||
|
||||
const toggleDashboard = () => {
|
||||
|
||||
console.log('toggle dashboard');
|
||||
|
||||
if (rightDashboardVisibility) {
|
||||
|
||||
// Hide dashboard
|
||||
hideDashboard();
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
// Show dashboard
|
||||
showDashboard();
|
||||
|
||||
// If centered box is hidden, open it
|
||||
if (centeredBox.classList.contains('hiddenBox')) {
|
||||
|
||||
console.log('centered box is hidden, reopening...');
|
||||
|
||||
// Rotate profile container
|
||||
rotateProfile();
|
||||
|
||||
// Toggle center box
|
||||
toggleCenteredBox();
|
||||
}
|
||||
}
|
||||
|
||||
console.log('toggle dashboard');
|
||||
// Check if any of these are open, if yes, close it
|
||||
if (weatherScreen.classList.contains('showWeatherScreen')) {
|
||||
console.log('weather screen is open, closing...');
|
||||
hideWeatherScreen();
|
||||
return
|
||||
} else if (webMenu.classList.contains('showWebMenu')) {
|
||||
console.log('web menu is open, closing...');
|
||||
hideWebMenu();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
dashboardOverlay.addEventListener(
|
||||
|
@ -239,6 +239,8 @@ const hideWeatherScreen = () => {
|
||||
|
||||
const toggleWeatherScreen = () => {
|
||||
|
||||
console.log('toggle weather screen');
|
||||
|
||||
// If profile anim is still running,
|
||||
// Return to avoid spam
|
||||
if (profileAnimRunning) return;
|
||||
@ -255,8 +257,17 @@ const toggleWeatherScreen = () => {
|
||||
showWeatherScreen();
|
||||
}
|
||||
|
||||
// Check if any of these are open, if yes, close it
|
||||
if (webMenu.classList.contains('showWebMenu')) {
|
||||
console.log('web menu is open, closing...');
|
||||
hideWebMenu();
|
||||
return;
|
||||
} else if (dashboard.classList.contains('showRightDashboard')) {
|
||||
console.log('dashboard is open, closing...');
|
||||
hideDashboard();
|
||||
return;
|
||||
}
|
||||
|
||||
// Toggle center box
|
||||
toggleCenteredBox();
|
||||
|
||||
console.log('toggle weather screen');
|
||||
}
|
@ -200,6 +200,8 @@ const hideWebMenu = () => {
|
||||
|
||||
const toggleWebMenu = () => {
|
||||
|
||||
console.log('toggle web menu');
|
||||
|
||||
// If profile anim is still running,
|
||||
// Return to avoid spam
|
||||
if (profileAnimRunning) return;
|
||||
@ -216,10 +218,19 @@ const toggleWebMenu = () => {
|
||||
showWebMenu();
|
||||
}
|
||||
|
||||
// Check if any of these are open, if yes, close it
|
||||
if (weatherScreen.classList.contains('showWeatherScreen')) {
|
||||
console.log('weather screen is open, closing...');
|
||||
hideWeatherScreen();
|
||||
return
|
||||
} else if (dashboard.classList.contains('showRightDashboard')) {
|
||||
console.log('dashboard is open, closing...');
|
||||
hideDashboard();
|
||||
return;
|
||||
}
|
||||
|
||||
// Toggle center box
|
||||
toggleCenteredBox();
|
||||
|
||||
console.log('toggle web menu');
|
||||
toggleCenteredBox();
|
||||
}
|
||||
|
||||
// Remove class to focused item
|
||||
|
Loading…
Reference in New Issue
Block a user