mirror of
https://github.com/glanceapp/glance.git
synced 2024-12-15 01:22:37 +03:00
Merge pull request #164 from dracarys18/main
fix: allow custom bangs without an argument
This commit is contained in:
commit
88ae2b8e83
@ -40,7 +40,6 @@ pages:
|
|||||||
columns:
|
columns:
|
||||||
- size: small
|
- size: small
|
||||||
widgets:
|
widgets:
|
||||||
- type: clock
|
|
||||||
- type: calendar
|
- type: calendar
|
||||||
|
|
||||||
- type: rss
|
- type: rss
|
||||||
|
@ -148,8 +148,7 @@ function setupSearchBoxes() {
|
|||||||
query = input;
|
query = input;
|
||||||
searchUrlTemplate = defaultSearchUrl;
|
searchUrlTemplate = defaultSearchUrl;
|
||||||
}
|
}
|
||||||
|
if (query.length == 0 && currentBang == null) {
|
||||||
if (query.length == 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,9 +170,13 @@ function setupSearchBoxes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleInput = (event) => {
|
const handleInput = (event) => {
|
||||||
const value = event.target.value.trimStart();
|
const value = event.target.value.trim();
|
||||||
const words = value.split(" ");
|
if (value in bangsMap) {
|
||||||
|
changeCurrentBang(bangsMap[value]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const words = value.split(" ");
|
||||||
if (words.length >= 2 && words[0] in bangsMap) {
|
if (words.length >= 2 && words[0] in bangsMap) {
|
||||||
changeCurrentBang(bangsMap[words[0]]);
|
changeCurrentBang(bangsMap[words[0]]);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user