changeset 8862:ba7c0397c3c1

comments: don't open comment form on page load for comments on line 0 Data attributes have magic parsing of strings so '0' becomes 0 which is false. Further, 0 == '' in JavaScript, so we have to use !== '' to catch empty strings.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 22 Feb 2021 12:12:38 +0100
parents 99ffd118f6af
children 0ce9f0754a46
files kallithea/public/js/base.js
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/js/base.js	Tue Feb 16 22:54:27 2021 +0100
+++ b/kallithea/public/js/base.js	Mon Feb 22 12:12:38 2021 +0100
@@ -528,7 +528,7 @@
         var line_no = $anchorcomment.data('line_no');
         if ($comment_div[0]) {
             $comment_div.append($anchorcomment.children());
-            if (f_path && line_no) {
+            if (f_path && line_no !== '') {
                 _comment_div_append_add($comment_div, f_path, line_no);
             } else {
                 _comment_div_append_form($comment_div, f_path, line_no);