mirror of
https://github.com/plausible/analytics.git
synced 2024-12-25 10:33:01 +03:00
97b24c0492
* Add SSO link with signed JWT token * Falls back to Nolt URL without SSO if token cannot be generated * Add profile image (gravatar) to Nolt SSO link * Improve navbar dropdown * Add 'contact support' link to nav dropdown * Add CSS rule to prevent horizontal jumps * Dark mode styling * Close dropdown when link is clicked * Clarify links in dropdown * Clarify CSS comment * Use Alpine.data() over window * Rename suggestions_dropdown -> combo-box * Mix format * Make logout link look good on dark mode * Use proxy for gravatar * Do not use Gravatar proxy in self-hosted * Changelog * Add Github Repo link to nav dropdown * Make dialyzer happy * Add proxy for Gravatar * Update assets/css/app.css Co-authored-by: hq1 <hq@mtod.org> * Update lib/plausible_web/controllers/avatar_controller.ex Co-authored-by: hq1 <hq@mtod.org> * Fix alpine <> Liveview integration --------- Co-authored-by: hq1 <hq@mtod.org>
27 lines
416 B
JavaScript
27 lines
416 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 && focusAfter.focus()
|
|
},
|
|
|
|
onPanelClick(e) {
|
|
if (e.target.tagName === 'A') {
|
|
this.close()
|
|
}
|
|
}
|
|
})
|