diff options
Diffstat (limited to 'plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts')
-rw-r--r-- | plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts b/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts index 11eec228a8..02580be10a 100644 --- a/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts +++ b/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts @@ -68,6 +68,18 @@ class MatomoUrl { $location.search(serializedParams); } + updateUrl(params: QueryParameters|string, hashParams: QueryParameters|string = {}) { + const serializedParams: string = typeof params !== 'string' ? this.stringify(params) : params; + const serializedHashParams: string = typeof hashParams !== 'string' ? this.stringify(hashParams) : hashParams; + + let url = `?${serializedParams}`; + if (serializedHashParams.length) { + url = `${url}#?${serializedHashParams}`; + } + + window.broadcast.propagateNewPage('', undefined, undefined, undefined, url); + } + getSearchParam(paramName: string): string { const hash = window.location.href.split('#'); |