aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/frontend/src/main/components/utils/requests.tsx
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2020-12-17 10:17:45 +0100
committerGitHub <noreply@github.com>2020-12-17 10:17:45 +0100
commit2f7ee2b82cda39f6bd94c5200b83563418b68dd7 (patch)
tree0942f00012ee7a90208c5d80ed3dd5ec6a3d9f92 /plugins/base/frontend/src/main/components/utils/requests.tsx
parent9e344b2047f72051bed509fb4e7ac1ae53f8098e (diff)
downloaddokka-2f7ee2b82cda39f6bd94c5200b83563418b68dd7.tar.gz
dokka-2f7ee2b82cda39f6bd94c5200b83563418b68dd7.tar.bz2
dokka-2f7ee2b82cda39f6bd94c5200b83563418b68dd7.zip
Navigate to root after logo click, add data to searchbars on multimodule (#1631)
Diffstat (limited to 'plugins/base/frontend/src/main/components/utils/requests.tsx')
-rw-r--r--plugins/base/frontend/src/main/components/utils/requests.tsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/base/frontend/src/main/components/utils/requests.tsx b/plugins/base/frontend/src/main/components/utils/requests.tsx
new file mode 100644
index 00000000..4a14e6f6
--- /dev/null
+++ b/plugins/base/frontend/src/main/components/utils/requests.tsx
@@ -0,0 +1,7 @@
+import { IWindow } from "../search/types"
+
+export const relativizeUrlForRequest = (filePath: string) : string => {
+ const pathToRoot = (window as IWindow).pathToRoot
+ const relativePath = pathToRoot == "" ? "." : pathToRoot
+ return relativePath.endsWith('/') ? `${relativePath}${filePath}` : `${relativePath}/${filePath}`
+} \ No newline at end of file