summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/common-global.js
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-03-25 19:37:55 +0100
committerEarl Warren <contact@earl-warren.org>2024-03-30 07:17:30 +0100
commitc55e30ff13d43fac40cc2064d3e17c035385279c (patch)
tree7debddd484411c78779a691ca04ee62376633411 /web_src/js/features/common-global.js
parentRemove fomantic table module (#30047) (diff)
downloadforgejo-c55e30ff13d43fac40cc2064d3e17c035385279c.tar.xz
forgejo-c55e30ff13d43fac40cc2064d3e17c035385279c.zip
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)
Diffstat (limited to '')
-rw-r--r--web_src/js/features/common-global.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js
index e2ce01eb49..18849ba7c1 100644
--- a/web_src/js/features/common-global.js
+++ b/web_src/js/features/common-global.js
@@ -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();
}
}