mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
getting rid of attributes like data-note-path in favor of the whole nav state in URLs
This commit is contained in:
@@ -9,6 +9,7 @@ import TabManager from "./tab_manager.js";
|
||||
import treeService from "../services/tree.js";
|
||||
import Component from "./component.js";
|
||||
import keyboardActionsService from "../services/keyboard_actions.js";
|
||||
import linkService from "../services/link.js";
|
||||
import MobileScreenSwitcherExecutor from "./mobile_screen_switcher.js";
|
||||
import MainTreeExecutors from "./main_tree_executors.js";
|
||||
import toast from "../services/toast.js";
|
||||
@@ -158,14 +159,9 @@ $(window).on('beforeunload', () => {
|
||||
});
|
||||
|
||||
$(window).on('hashchange', function() {
|
||||
if (treeService.isNotePathInAddress()) {
|
||||
const {notePath, ntxId, viewScope} = treeService.parseNavigationStateFromAddress();
|
||||
|
||||
if (!notePath && !ntxId) {
|
||||
console.log(`Invalid hash value "${document.location.hash}", ignoring.`);
|
||||
return;
|
||||
}
|
||||
const {notePath, ntxId, viewScope} = linkService.parseNavigationStateFromUrl(window.location.href);
|
||||
|
||||
if (notePath || ntxId) {
|
||||
appContext.tabManager.switchToNoteContext(ntxId, notePath, viewScope);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user