Fix initCompLabelEdit not being called (#29198)

Fix broken `if` from https://github.com/go-gitea/gitea/pull/29195

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 2d8756a9607ee6029ad7a44985e9751988d5fdaa)
This commit is contained in:
Yarden Shoham 2024-02-16 18:03:52 +02:00 committed by Earl Warren
parent 6a4b83fb9d
commit 1d4ce531fd
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 0579CB2928A78A00

View file

@ -6,9 +6,7 @@ export function initCommonOrganization() {
return; return;
} }
const orgNameInput = document.querySelector('.organization.settings.options #org_name'); document.querySelector('.organization.settings.options #org_name')?.addEventListener('input', function () {
if (!orgNameInput) return;
orgNameInput.addEventListener('input', function () {
const nameChanged = this.value.toLowerCase() !== this.getAttribute('data-org-name').toLowerCase(); const nameChanged = this.value.toLowerCase() !== this.getAttribute('data-org-name').toLowerCase();
toggleElem('#org-name-change-prompt', nameChanged); toggleElem('#org-name-change-prompt', nameChanged);
}); });