mirror of
https://github.com/xvvvyz/tilde.git
synced 2026-03-11 14:44:24 +00:00
don't do anything on enter if input is blank
This commit is contained in:
parent
c40edb3031
commit
9277b70d14
1 changed files with 4 additions and 1 deletions
|
|
@ -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: ' ',
|
||||
|
|
|
|||
Loading…
Reference in a new issue