Skip to content

Commit 070f610

Browse files
author
Nicos
committed
Alert user to insert text if search is empty
Relates to #66
1 parent 7fb89fc commit 070f610

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

public/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ xhrRequest("/latest", displayResults);
3131
button.addEventListener("click", function(e) {
3232
e.preventDefault();
3333
var q = input.value.toLowerCase().trim();
34-
if (q) {
34+
if (q === '') {
35+
input.style.boxShadow = "0 0 10px red";
36+
input.placeholder = "Please type some text";
37+
} else {
38+
input.style.boxShadow = "0 0 0 grey";
3539
clearContents();
3640
var query = "?q=" + q;
3741
var url = "/search" + query;

0 commit comments

Comments
 (0)