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