forked from extern/the-glorious-startpage
fix searchbox switching problems
This commit is contained in:
parent
35c932aa8f
commit
c7cf0dcbec
@ -1,6 +1,4 @@
|
|||||||
#searchBoxContainer {
|
#searchBoxContainer {
|
||||||
|
|
||||||
background: #ff00ff;
|
|
||||||
|
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
@ -53,7 +53,12 @@ const toggleDashboard = () => {
|
|||||||
if (weatherScreen.classList.contains('showWeatherScreen')) {
|
if (weatherScreen.classList.contains('showWeatherScreen')) {
|
||||||
console.log('weather screen is open, closing...');
|
console.log('weather screen is open, closing...');
|
||||||
hideWeatherScreen();
|
hideWeatherScreen();
|
||||||
return
|
return;
|
||||||
|
|
||||||
|
} else if (searchBoxContainer.classList.contains('showSearchBox')) {
|
||||||
|
console.log('searchbox is open, closing...');
|
||||||
|
hideSearchBox();
|
||||||
|
|
||||||
} else if (webMenu.classList.contains('showWebMenu')) {
|
} else if (webMenu.classList.contains('showWebMenu')) {
|
||||||
console.log('web menu is open, closing...');
|
console.log('web menu is open, closing...');
|
||||||
hideWebMenu();
|
hideWebMenu();
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
var searchBoxContainer = document.getElementById('searchBoxContainer');
|
|
||||||
|
|
||||||
var searchBox = document.getElementById('searchBox');
|
var searchBox = document.getElementById('searchBox');
|
||||||
|
var searchBoxContainer = document.getElementById('searchBoxContainer');
|
||||||
var centeredBoxOverlay = document.getElementById('centeredBoxOverlay');
|
var centeredBoxOverlay = document.getElementById('centeredBoxOverlay');
|
||||||
|
|
||||||
let searchBoxVisility = false;
|
let searchBoxVisility = false;
|
||||||
@ -12,11 +11,19 @@ const showSearchBox = () => {
|
|||||||
searchBox.focus();
|
searchBox.focus();
|
||||||
|
|
||||||
searchBoxVisility = !searchBoxVisility;
|
searchBoxVisility = !searchBoxVisility;
|
||||||
|
|
||||||
|
// Toggle overlay
|
||||||
|
centeredBoxOverlay.classList.toggle('showOverlay');
|
||||||
}
|
}
|
||||||
|
|
||||||
const hideSearchBox = () => {
|
const hideSearchBox = () => {
|
||||||
searchBoxContainer.classList.remove('showSearchBox');
|
searchBoxContainer.classList.remove('showSearchBox');
|
||||||
|
|
||||||
|
// Toggle overlay
|
||||||
|
centeredBoxOverlay.classList.toggle('showOverlay');
|
||||||
|
|
||||||
|
searchBox.value = '';
|
||||||
|
|
||||||
searchBoxVisility = !searchBoxVisility;
|
searchBoxVisility = !searchBoxVisility;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,8 +45,5 @@ const toggleSearchBox = () => {
|
|||||||
showSearchBox();
|
showSearchBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show overlay
|
|
||||||
centeredBoxOverlay.classList.toggle('showOverlay');
|
|
||||||
|
|
||||||
console.log('toggle searchbox');
|
console.log('toggle searchbox');
|
||||||
}
|
}
|
@ -262,6 +262,11 @@ const toggleWeatherScreen = () => {
|
|||||||
console.log('web menu is open, closing...');
|
console.log('web menu is open, closing...');
|
||||||
hideWebMenu();
|
hideWebMenu();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
} else if (searchBoxContainer.classList.contains('showSearchBox')) {
|
||||||
|
console.log('searchbox is open, closing...');
|
||||||
|
hideSearchBox();
|
||||||
|
|
||||||
} else if (dashboard.classList.contains('showRightDashboard')) {
|
} else if (dashboard.classList.contains('showRightDashboard')) {
|
||||||
console.log('dashboard is open, closing...');
|
console.log('dashboard is open, closing...');
|
||||||
hideDashboard();
|
hideDashboard();
|
||||||
|
@ -224,14 +224,19 @@ const toggleWebMenu = () => {
|
|||||||
if (weatherScreen.classList.contains('showWeatherScreen')) {
|
if (weatherScreen.classList.contains('showWeatherScreen')) {
|
||||||
console.log('weather screen is open, closing...');
|
console.log('weather screen is open, closing...');
|
||||||
hideWeatherScreen();
|
hideWeatherScreen();
|
||||||
return
|
return;
|
||||||
|
|
||||||
|
} else if (searchBoxContainer.classList.contains('showSearchBox')) {
|
||||||
|
console.log('searchbox is open, closing...');
|
||||||
|
hideSearchBox();
|
||||||
|
|
||||||
} else if (dashboard.classList.contains('showRightDashboard')) {
|
} else if (dashboard.classList.contains('showRightDashboard')) {
|
||||||
console.log('dashboard is open, closing...');
|
console.log('dashboard is open, closing...');
|
||||||
hideDashboard();
|
hideDashboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toggle center box
|
// Toggle center box
|
||||||
toggleCenteredBox();
|
toggleCenteredBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove class to focused item
|
// Remove class to focused item
|
||||||
|
Loading…
Reference in New Issue
Block a user