aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docs/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'docs/plugins')
-rw-r--r--docs/plugins/menu.ts48
-rw-r--r--docs/plugins/scrollbars.client.ts5
2 files changed, 0 insertions, 53 deletions
diff --git a/docs/plugins/menu.ts b/docs/plugins/menu.ts
deleted file mode 100644
index 82512c3..0000000
--- a/docs/plugins/menu.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-export default defineNuxtPlugin((ctx: any) => {
- // Menu visible reference
- const visible = ref(false)
-
- // Open the menu
- const open = () => (visible.value = true)
-
- // Close the menu
- const close = () => (visible.value = false)
-
- // Toggle the menu (useful for one-off buttons)
- const toggle = () => (visible.value = !visible.value)
-
- // Watch route change, close on change
- ctx.$router.afterEach(() => setTimeout(close, 50))
-
- // Watch visible and remove overflow so the scrollbar disappears when menu is opened
- if (process.client) {
- watch(
- visible,
- (isVisible) => {
- const html = document.documentElement
-
- if (isVisible) {
- html.style.overflow = 'hidden'
- } else {
- setTimeout(() => {
- html.style.overflow = ''
- }, 100) /* had to put it, because of layout shift on leave transition */
- }
- },
- {
- immediate: true
- }
- )
- }
-
- return {
- provide: {
- menu: {
- visible,
- close,
- open,
- toggle
- }
- }
- }
-})
diff --git a/docs/plugins/scrollbars.client.ts b/docs/plugins/scrollbars.client.ts
deleted file mode 100644
index d1078cf..0000000
--- a/docs/plugins/scrollbars.client.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export default defineNuxtPlugin(() => {
- if (navigator && navigator.userAgent && navigator.userAgent.match(/Win[a-z0-9]*;/)) {
- document.documentElement.classList.add('docus-scrollbars')
- }
-})