forked from forgejo/forgejo
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. (cherry picked from commit 8fe26fb314f1710139728d9118b455fc6a16cce2)
This commit is contained in:
parent
c5745f9d24
commit
c55e30ff13
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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue