aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/main.js
diff options
context:
space:
mode:
authorBuildTools <unconfigured@null.spigotmc.org>2016-12-06 19:24:31 +0100
committerBuildTools <unconfigured@null.spigotmc.org>2016-12-06 19:24:31 +0100
commit186b477085d63e23566d9ac4c11a36cde178e14e (patch)
tree00219de4f0cd004d8ec87555d2ad2133a5df9339 /public/javascripts/main.js
parentf6bd3626cc83a68f38493edd96b871e94d54d60d (diff)
hide week selector when didn't search
Diffstat (limited to 'public/javascripts/main.js')
-rw-r--r--public/javascripts/main.js6
1 files changed, 4 insertions, 2 deletions
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()
}