From 7f53983d77cd1b197b8cdd27b8c7c949da321d2d Mon Sep 17 00:00:00 2001 From: CalDescent Date: Sun, 9 Apr 2023 18:21:19 +0100 Subject: [PATCH] Added support for hash routing in URL shown in address bar. --- src/main/resources/q-apps/q-apps.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/resources/q-apps/q-apps.js b/src/main/resources/q-apps/q-apps.js index 56f13717..0661a095 100644 --- a/src/main/resources/q-apps/q-apps.js +++ b/src/main/resources/q-apps/q-apps.js @@ -389,13 +389,14 @@ document.addEventListener('DOMContentLoaded', () => { * Handle app navigation */ navigation.addEventListener('navigate', (event) => { - let pathname = new URL(event.destination.url).pathname; + const url = new URL(event.destination.url); + let fullpath = url.pathname + url.hash; qortalRequest({ action: "QDN_RESOURCE_DISPLAYED", service: _qdnService, name: _qdnName, identifier: _qdnIdentifier, - path: (pathname.startsWith(_qdnBase)) ? pathname.slice(_qdnBase.length) : pathname + path: (fullpath.startsWith(_qdnBase)) ? fullpath.slice(_qdnBase.length) : fullpath }); });