1
0
mirror of https://gitcode.com/gitea/gitea.git synced 2025-07-09 14:46:41 +08:00

Refactor all .length === 0 patterns in JS ()

This pattern comes of often during review, so let's fix it once and for
all. Did not test, but changes are trivial enough imho.
This commit is contained in:
silverwind
2024-03-25 19:37:55 +01:00
committed by GitHub
parent f73d891fc4
commit 8fe26fb314
14 changed files with 31 additions and 40 deletions

@ -19,7 +19,7 @@ const {appUrl, appSubUrl, csrfToken, i18n} = window.config;
export function initGlobalFormDirtyLeaveConfirm() {
// Warn users that try to leave a page after entering data into a form.
// Except on sign-in pages, and for forms marked as 'ignore-dirty'.
if ($('.user.signin').length === 0) {
if (!$('.user.signin').length) {
$('form:not(.ignore-dirty)').areYouSure();
}
}