changeset 5162:9c067ee8d368 stable

changeset comment: fix delete button issue issue: when deleting comments in a list of comments on the same line, sometimes the add new comment button stops working root cause: when deleting a comment in a list of comments that are all on the same line, the wrong previous tr is chosen, the chosen tr could be an inline comments instead of a line tr, resulting in the fact that injectinlineform function will return immediatly solution: loop over the found tr until its no longer an inline comment remark: could probably be optimised futher to immediatly search for the line tr object
author Jan Heylen <heyleke@gmail.com>
date Fri, 29 May 2015 18:18:23 +0200
parents 83e0a4ce1c07
children 06c4ff173b5b 3e1afbd6055f
files kallithea/public/js/base.js
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/js/base.js	Sun May 31 13:56:27 2015 +0200
+++ b/kallithea/public/js/base.js	Fri May 29 18:18:23 2015 +0200
@@ -736,6 +736,9 @@
     var success = function(o){
         var $deleted = $('#comment-tr-'+comment_id);
         var $prev = $deleted.prev('tr');
+        while ($prev.hasClass('inline-comments')){
+            $prev = $prev.prev('tr');
+        }
         $deleted.remove();
         _placeAddButton($prev);
     }