Skip to content

Commit

Permalink
Fixd eslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
penxian committed Dec 12, 2024
1 parent 5697532 commit 703a1cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions source/js/third-party/search/algolia-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ document.addEventListener('DOMContentLoaded', () => {
// Handle and trigger popup window
document.querySelectorAll('.popup-trigger').forEach(element => {
element.addEventListener('click', () => {
document.body.style.setProperty("--dialog-scrollgutter", `${window.innerWidth - document.body.clientWidth}px`);
document.body.style.setProperty('--dialog-scrollgutter', `${window.innerWidth - document.body.clientWidth}px`);
document.body.classList.add('search-active');
// Wait for search-popup animation to complete
setTimeout(() => input.focus(), 500);
Expand All @@ -105,7 +105,7 @@ document.addEventListener('DOMContentLoaded', () => {

// Monitor main search box
const onPopupClose = () => {
document.body.style.setProperty("--dialog-scrollgutter", 0);
document.body.style.setProperty('--dialog-scrollgutter', 0);
document.body.classList.remove('search-active');
};

Expand All @@ -119,7 +119,7 @@ document.addEventListener('DOMContentLoaded', () => {
window.addEventListener('keydown', event => {
if ((event.ctrlKey || event.metaKey) && event.key === 'k') {
event.preventDefault();
document.body.style.setProperty("--dialog-scrollgutter", `${window.innerWidth - document.body.clientWidth}px`);
document.body.style.setProperty('--dialog-scrollgutter', `${window.innerWidth - document.body.clientWidth}px`);
document.body.classList.add('search-active');
setTimeout(() => input.focus(), 500);
}
Expand Down
6 changes: 3 additions & 3 deletions source/js/third-party/search/local-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ document.addEventListener('DOMContentLoaded', () => {
// Handle and trigger popup window
document.querySelectorAll('.popup-trigger').forEach(element => {
element.addEventListener('click', () => {
document.body.style.setProperty("--dialog-scrollgutter", `${window.innerWidth - document.body.clientWidth}px`);
document.body.style.setProperty('--dialog-scrollgutter', `${window.innerWidth - document.body.clientWidth}px`);
document.body.classList.add('search-active');
// Wait for search-popup animation to complete
setTimeout(() => input.focus(), 500);
Expand All @@ -67,7 +67,7 @@ document.addEventListener('DOMContentLoaded', () => {

// Monitor main search box
const onPopupClose = () => {
document.body.style.setProperty("--dialog-scrollgutter", 0);
document.body.style.setProperty('--dialog-scrollgutter', 0);
document.body.classList.remove('search-active');
};

Expand All @@ -84,7 +84,7 @@ document.addEventListener('DOMContentLoaded', () => {
window.addEventListener('keydown', event => {
if ((event.ctrlKey || event.metaKey) && event.key === 'k') {
event.preventDefault();
document.body.style.setProperty("--dialog-scrollgutter", `${window.innerWidth - document.body.clientWidth}px`)
document.body.style.setProperty('--dialog-scrollgutter', `${window.innerWidth - document.body.clientWidth}px`);
document.body.classList.add('search-active');
setTimeout(() => input.focus(), 500);
if (!localSearch.isfetched) localSearch.fetchData();
Expand Down

0 comments on commit 703a1cf

Please sign in to comment.