mirror of
https://github.com/goauthentik/authentik
synced 2026-05-09 16:42:38 +02:00
static: close modal on escape key
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -25,6 +25,15 @@ export class ModalButton extends LitElement {
|
||||
return [ModalBoxStyle, BullseyeStyle, BackdropStyle]
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
window.addEventListener("keyup", e => {
|
||||
if (e.code === "Escape") {
|
||||
this.open = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setContent(content: string) {
|
||||
this.querySelector("[slot=modal]")!.innerHTML = content;
|
||||
// Ensure links close the modal
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import "./legacy.js";
|
||||
|
||||
import "./AdminLoginsChart";
|
||||
import './AdminSidebar';
|
||||
import './ActionButton';
|
||||
import './AdminSidebar';
|
||||
import './AdminSiteShell';
|
||||
import "./AdminLoginsChart";
|
||||
import './Dropdown';
|
||||
import './FetchFillSlot';
|
||||
import './FlowShellCard';
|
||||
import './Messages';
|
||||
import './Tabs';
|
||||
import './ModalButton';
|
||||
import './AdminSiteShell';
|
||||
import './Tabs';
|
||||
|
||||
Reference in New Issue
Block a user