astro-accelerator 5.9.11 → 5.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/css/main.css +1 -0
- package/public/js/search.js +0 -30
package/package.json
CHANGED
package/public/css/main.css
CHANGED
package/public/js/search.js
CHANGED
|
@@ -169,36 +169,6 @@ function initializeSearch() {
|
|
|
169
169
|
|
|
170
170
|
function openDropdown() {
|
|
171
171
|
siteSearchElement.classList.add('is-active');
|
|
172
|
-
|
|
173
|
-
requestAnimationFrame(() => {
|
|
174
|
-
const dropdownHeightPercentage = parseFloat(
|
|
175
|
-
getComputedStyle(siteSearchWrapper).getPropertyValue(
|
|
176
|
-
'--search-dropdown-height'
|
|
177
|
-
)
|
|
178
|
-
);
|
|
179
|
-
// Convert vh to pixels
|
|
180
|
-
const dropdownHeight =
|
|
181
|
-
window.innerHeight * (dropdownHeightPercentage / 100) + 32;
|
|
182
|
-
const siteSearchElementRect =
|
|
183
|
-
siteSearchElement.getBoundingClientRect();
|
|
184
|
-
const offsetFromBottomToElement =
|
|
185
|
-
window.innerHeight - siteSearchElementRect.bottom;
|
|
186
|
-
|
|
187
|
-
if (offsetFromBottomToElement < dropdownHeight) {
|
|
188
|
-
document.body.style.overflow = '';
|
|
189
|
-
|
|
190
|
-
// Scroll to the siteSearchElement
|
|
191
|
-
siteSearchElement.scrollIntoView({
|
|
192
|
-
behavior: 'smooth',
|
|
193
|
-
block: 'start',
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
// Delay the overflow to allow for smooth scrolling
|
|
197
|
-
setTimeout(() => {
|
|
198
|
-
document.body.style.overflow = 'hidden';
|
|
199
|
-
}, 300);
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
172
|
}
|
|
203
173
|
|
|
204
174
|
function closeDropdown() {
|