File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ const { trailingSlashes = false } = Astro.props
8888 #openBtn: HTMLButtonElement | null
8989 #controller: AbortController
9090 trailingSlashes: boolean
91+ stripTrailingSlash: (path: string) => string
92+ formatURL: (path: string) => string
9193
9294 constructor() {
9395 super()
@@ -120,6 +122,8 @@ const { trailingSlashes = false } = Astro.props
120122 if (this.#dialog) {
121123 this.#dialog.addEventListener('close', () => {
122124 window.removeEventListener('click', this.onWindowClick)
125+ const body = document.querySelector('body')
126+ body?.classList.remove('overflow-hidden')
123127 })
124128 } else {
125129 console.warn('Dialog not found')
@@ -184,8 +188,6 @@ const { trailingSlashes = false } = Astro.props
184188 }
185189
186190 closeModal = () => {
187- const body = document.querySelector('body')
188- body?.classList.remove('overflow-hidden')
189191 this.#dialog?.close()
190192 }
191193
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ function kebabToTitleCase(str: string): string {
9191 if (this.#dialog) {
9292 this.#dialog.addEventListener('close', () => {
9393 window.removeEventListener('click', this.onWindowClick)
94+ const body = document.querySelector('body')
95+ body?.classList.remove('overflow-hidden')
9496 })
9597 } else {
9698 console.warn('Dialog not found')
@@ -137,8 +139,6 @@ function kebabToTitleCase(str: string): string {
137139 }
138140
139141 closeModal = () => {
140- const body = document.querySelector('body')
141- body?.classList.remove('overflow-hidden')
142142 this.#dialog?.close()
143143 }
144144
You can’t perform that action at this time.
0 commit comments