JS: test for length explicitly. (#1240)

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
XhmikosR
2020-05-04 10:50:13 +03:00
committed by GitHub
parent acba118a42
commit 0e35b415ea
3 changed files with 8 additions and 3 deletions

View File

@@ -192,7 +192,7 @@ function testCookies() {
}
$(function () {
if (!testCookies() && $("#cookieInfo").length) {
if (!testCookies() && $("#cookieInfo").length > 0) {
$("#cookieInfo").show();
}
});

View File

@@ -225,7 +225,7 @@ $(".nav-tabs a").on("shown.bs.tab", function (e) {
// Auto dismissal for info notifications
$(document).ready(function () {
var alInfo = $("#alInfo");
if (alInfo.length) {
if (alInfo.length > 0) {
alInfo.delay(3000).fadeOut(2000, function () {
alInfo.hide();
});