From 186b477085d63e23566d9ac4c11a36cde178e14e Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 6 Dec 2016 19:24:31 +0100 Subject: hide week selector when didn't search --- public/javascripts/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'public/javascripts/main.js') diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 41b096a..62bf3a2 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -89,7 +89,7 @@ searchNode.addEventListener('keydown', function (e) { }) searchNode.addEventListener('input', function (e) { - document.body.className = '' + document.body.classList.remove('no-input') autocompleteNode.innerHTML = '' if (inputNode.value.trim() === '') return @@ -115,6 +115,8 @@ function submitForm (e) { } if (selectedUser == null) return + document.body.classList.add('searched') + updateFavNode() inputNode.value = selectedUser.value @@ -217,7 +219,7 @@ if (currentFav) { ga('send', { hitType: 'event', eventCategory: 'search fav', eventAction, eventLabel }) }) } else if (inputNode.value === '') { - document.body.className = 'no-input' + document.body.classList.add('no-input') inputNode.focus() } -- cgit v1.1