This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/web/src/elements/buttons/Dropdown.ts

19 lines
529 B
TypeScript
Raw Normal View History

import { customElement, html, LitElement } from "lit-element";
@customElement("pb-dropdown")
export class DropdownButton extends LitElement {
constructor() {
2020-11-21 19:48:49 +00:00
super();
const menu = <HTMLElement>this.querySelector(".pf-c-dropdown__menu")!;
this.querySelectorAll("button.pf-c-dropdown__toggle").forEach((btn) => {
2020-11-21 19:48:49 +00:00
btn.addEventListener("click", (e) => {
menu.hidden = !menu.hidden;
});
});
}
render() {
return html`<slot></slot>`;
}
}