mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-27 03:25:16 +02:00
parent
70c465806c
commit
68b9925c93
1 changed files with 4 additions and 2 deletions
|
@ -16,6 +16,8 @@ import {
|
||||||
onMediaQueryListEvent,
|
onMediaQueryListEvent,
|
||||||
} from './wowchemy-theming';
|
} from './wowchemy-theming';
|
||||||
|
|
||||||
|
const searchEnabled = (typeof search_config !== 'undefined');
|
||||||
|
|
||||||
console.debug(`Environment: ${hugoEnvironment}`)
|
console.debug(`Environment: ${hugoEnvironment}`)
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------
|
/* ---------------------------------------------------------------------------
|
||||||
|
@ -565,7 +567,7 @@ $(window).on('load', function () {
|
||||||
document.activeElement
|
document.activeElement
|
||||||
) || null;
|
) || null;
|
||||||
let isInputFocused = focusedElement instanceof HTMLInputElement || focusedElement instanceof HTMLTextAreaElement;
|
let isInputFocused = focusedElement instanceof HTMLInputElement || focusedElement instanceof HTMLTextAreaElement;
|
||||||
if (search_config && !isInputFocused) {
|
if (searchEnabled && !isInputFocused) {
|
||||||
// Open search dialog.
|
// Open search dialog.
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
toggleSearchDialog();
|
toggleSearchDialog();
|
||||||
|
@ -575,7 +577,7 @@ $(window).on('load', function () {
|
||||||
|
|
||||||
// Search event handler
|
// Search event handler
|
||||||
// Check that built-in search or Algolia enabled.
|
// Check that built-in search or Algolia enabled.
|
||||||
if (search_config) {
|
if (searchEnabled) {
|
||||||
// On search icon click toggle search dialog.
|
// On search icon click toggle search dialog.
|
||||||
$('.js-search').click(function (e) {
|
$('.js-search').click(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue