mirror of
https://github.com/glanceapp/glance.git
synced 2024-11-22 00:13:55 +01:00
fix: allow custom bangs without an argument
This commit is contained in:
parent
6c15c907bf
commit
3805f8b156
@ -147,8 +147,7 @@ function setupSearchboxes() {
|
||||
query = input;
|
||||
searchUrlTemplate = defaultSearchUrl;
|
||||
}
|
||||
|
||||
if (query.length == 0) {
|
||||
if (query.length == 0 && currentBang == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -170,9 +169,13 @@ function setupSearchboxes() {
|
||||
}
|
||||
|
||||
const handleInput = (event) => {
|
||||
const value = event.target.value.trimStart();
|
||||
const words = value.split(" ");
|
||||
const value = event.target.value.trim();
|
||||
if (value in bangsMap) {
|
||||
changeCurrentBang(bangsMap[value]);
|
||||
return;
|
||||
}
|
||||
|
||||
const words = value.split(" ");
|
||||
if (words.length >= 2 && words[0] in bangsMap) {
|
||||
changeCurrentBang(bangsMap[words[0]]);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user