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
559 B
TypeScript
Raw Normal View History

import { customElement, html, LitElement, TemplateResult } 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) => {
btn.addEventListener("click", () => {
menu.hidden = !menu.hidden;
});
});
}
render(): TemplateResult {
return html`<slot></slot>`;
}
}