don't do anything on enter if input is blank

This commit is contained in:
Cade Scroggins 2016-05-31 20:18:48 -07:00
parent c40edb3031
commit 9277b70d14

View file

@ -170,6 +170,10 @@
});
searchForm.addEventListener('submit', function(event) {
event.preventDefault();
if (searchInput.value === '') return false;
var redirect = opts.defaultCommand + encodeURIComponent(q);
var q = searchInput.value.split(opts.delimiter);
@ -186,7 +190,6 @@
});
window.location.href = redirect;
event.preventDefault();
}, false);
})({
delimiter: ' ',