mirror of
https://github.com/manilarome/the-glorious-startpage.git
synced 2024-11-24 16:43:38 +01:00
41 lines
853 B
JavaScript
41 lines
853 B
JavaScript
|
var dashboard = document.getElementById("rightDashboard");
|
||
|
|
||
|
let rightDashboardVisibility = false;
|
||
|
|
||
|
|
||
|
const showDashboard = () => {
|
||
|
dashboard.classList.add('showRightDashboard');
|
||
|
|
||
|
rightDashboardVisibility = !rightDashboardVisibility;
|
||
|
}
|
||
|
|
||
|
const hideDashboard = () => {
|
||
|
dashboard.classList.remove('showRightDashboard');
|
||
|
dashboard.scrollTop = 0;
|
||
|
|
||
|
rightDashboardVisibility = !rightDashboardVisibility;
|
||
|
}
|
||
|
|
||
|
const toggleDashboard = () => {
|
||
|
|
||
|
// If profile anim is still running,
|
||
|
// Return to avoid spam
|
||
|
if (profileAnimRunning) return;
|
||
|
|
||
|
// Rotate profile
|
||
|
rotateProfile();
|
||
|
|
||
|
if (rightDashboardVisibility) {
|
||
|
// Hide search box
|
||
|
hideDashboard();
|
||
|
|
||
|
} else {
|
||
|
// Show search box
|
||
|
showDashboard();
|
||
|
}
|
||
|
|
||
|
// Show overlay
|
||
|
// centeredBoxOverlay.classList.toggle('showOverlay');
|
||
|
|
||
|
console.log('toggle dashboard');
|
||
|
}
|