mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 10:02:10 +03:00
039f3baf8e
* Add typescript, rewrite Countries map * Add back DB IP geolocation notice * Silence all current eslint warnings: to be removed gradually * Reconfigure eslint import plugin for typescript * Insert formatting pragma by default, but ignore files without pragma in CI
21 lines
317 B
JavaScript
21 lines
317 B
JavaScript
// From https://alpinejs.dev/component/dropdown
|
|
|
|
export default () => ({
|
|
open: false,
|
|
toggle() {
|
|
if (this.open) {
|
|
return this.close()
|
|
}
|
|
|
|
this.$refs.button.focus()
|
|
this.open = true
|
|
},
|
|
|
|
close(focusAfter) {
|
|
if (! this.open) return
|
|
|
|
this.open = false
|
|
focusAfter?.focus()
|
|
},
|
|
})
|