From 32967791258f93d22d7b282ed1503386e8dafb1d Mon Sep 17 00:00:00 2001 From: CalDescent Date: Sun, 9 Apr 2023 17:11:20 +0100 Subject: [PATCH] Update address bar when navigating within an app. --- src/main/resources/q-apps/q-apps.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/resources/q-apps/q-apps.js b/src/main/resources/q-apps/q-apps.js index ff39ce72..56f13717 100644 --- a/src/main/resources/q-apps/q-apps.js +++ b/src/main/resources/q-apps/q-apps.js @@ -385,6 +385,20 @@ document.addEventListener('DOMContentLoaded', () => { }); }); +/** + * Handle app navigation + */ +navigation.addEventListener('navigate', (event) => { + let pathname = new URL(event.destination.url).pathname; + qortalRequest({ + action: "QDN_RESOURCE_DISPLAYED", + service: _qdnService, + name: _qdnName, + identifier: _qdnIdentifier, + path: (pathname.startsWith(_qdnBase)) ? pathname.slice(_qdnBase.length) : pathname + }); +}); + /** * Intercept image loads from the DOM */