hoisting support in mobile view WIP

This commit is contained in:
zadam
2022-12-13 16:57:46 +01:00
parent 2957e1d78a
commit ca968a9e31
10 changed files with 63 additions and 52 deletions

View File

@@ -150,19 +150,11 @@ $(window).on('beforeunload', () => {
}
});
function isNotePathInAddress() {
const [notePath, ntxId] = treeService.getHashValueFromAddress();
return notePath.startsWith("root")
// empty string is for empty/uninitialized tab
|| (notePath === '' && !!ntxId);
}
$(window).on('hashchange', function() {
if (isNotePathInAddress()) {
if (treeService.isNotePathInAddress()) {
const [notePath, ntxId] = treeService.getHashValueFromAddress();
if (!notePath) {
if (!notePath && !ntxId) {
console.log(`Invalid hash value "${document.location.hash}", ignoring.`);
return;
}