mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
invites: editable label, /invites/edit route
PATCH /invite/edit lets you edit an invite by giving new values for a subset of inviteDTO (EditableInviteDTO). Replaces /invite/profile and /invite/notify, and allows changing (user)label and user expiry as well as the previously customizable values through other routes. An edit button next to the code/label allows changing on the invites tab.
This commit is contained in:
@@ -44,6 +44,14 @@ export class HiddenInputField {
|
||||
this._toggle.onclick = () => {
|
||||
this.editing = !this.editing;
|
||||
};
|
||||
this._input.addEventListener("keypress", (e: KeyboardEvent) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
this._toggle.click();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
this.setEditing(false, true);
|
||||
}
|
||||
@@ -66,6 +74,7 @@ export class HiddenInputField {
|
||||
this._toggle.classList.add(HiddenInputField.saveClass);
|
||||
this._toggle.classList.remove(HiddenInputField.editClass);
|
||||
this._input.classList.remove("hidden");
|
||||
this._input.focus();
|
||||
this._content.classList.add("hidden");
|
||||
} else {
|
||||
document.removeEventListener("click", this.outerClickListener);
|
||||
|
||||
Reference in New Issue
Block a user