mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-17 00:31:41 +08:00
feat(client): allow triggering search on hash change
This commit is contained in:
parent
79cc1cbf17
commit
89767d0135
@ -551,10 +551,12 @@ $(window).on("beforeunload", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(window).on("hashchange", function () {
|
$(window).on("hashchange", function () {
|
||||||
const { notePath, ntxId, viewScope } = linkService.parseNavigationStateFromUrl(window.location.href);
|
const { notePath, ntxId, viewScope, searchString } = linkService.parseNavigationStateFromUrl(window.location.href);
|
||||||
|
|
||||||
if (notePath || ntxId) {
|
if (notePath || ntxId) {
|
||||||
appContext.tabManager.switchToNoteContext(ntxId, notePath, viewScope);
|
appContext.tabManager.switchToNoteContext(ntxId, notePath, viewScope);
|
||||||
|
} else if (searchString) {
|
||||||
|
appContext.triggerCommand("searchNotes", { searchString });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user