mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 01:57:20 +00:00
Refactor all .length === 0
patterns in JS (#30045)
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:
@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user