From e9ceb3250ca46319b9aa0c10d1180c4c4560b65f Mon Sep 17 00:00:00 2001 From: zzossig Date: Sat, 8 Feb 2020 23:48:40 +0900 Subject: [PATCH] [chore] var naming problem fix --- layouts/partials/head/scripts.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/layouts/partials/head/scripts.html b/layouts/partials/head/scripts.html index b516eb1..c6fc9f0 100644 --- a/layouts/partials/head/scripts.html +++ b/layouts/partials/head/scripts.html @@ -844,12 +844,12 @@ var searchElem = document.getElementById('search'); var searchMobile = document.getElementById('search-mobile'); - var searchResults = document.getElementById('search-results'); + var searchResultsContainer = document.getElementById('search-results'); searchElem ? searchElem.addEventListener('input', function(e) { if (!e.target.value | window.innerWidth < 770) { - searchResults ? searchResults.setAttribute('class', 'dropdown') : null; + searchResultsContainer ? searchResultsContainer.setAttribute('class', 'dropdown') : null; searchResult ? searchResult.setAttribute('data-display', 'none') : null; summaryContainer ? summaryContainer.setAttribute('data-display', 'block') : null; return null; @@ -871,7 +871,7 @@ renderSearchResultsSide(searchText, results); } - var dropdownItems = searchResults.querySelectorAll('.dropdown-item'); + var dropdownItems = searchResultsContainer.querySelectorAll('.dropdown-item'); dropdownItems ? dropdownItems.forEach(function(item) { item.addEventListener('mousedown', function(e) { e.target.click(); @@ -885,7 +885,7 @@ if (window.innerWidth < 770) { return null; } - searchResults ? searchResults.setAttribute('class', 'dropdown') : null; + searchResultsContainer ? searchResultsContainer.setAttribute('class', 'dropdown') : null; }) : null; searchElem ? @@ -894,7 +894,7 @@ return null; } if (!e.target.value) { - searchResults ? searchResults.setAttribute('class', 'dropdown') : null; + searchResultsContainer ? searchResultsContainer.setAttribute('class', 'dropdown') : null; return null; } @@ -914,7 +914,7 @@ renderSearchResultsSide(searchText, results); } - var dropdownItems = searchResults.querySelectorAll('.dropdown-item'); + var dropdownItems = searchResultsContainer.querySelectorAll('.dropdown-item'); dropdownItems ? dropdownItems.forEach(function (item) { item.addEventListener('mousedown', function (e) { e.target.click();