# HG changeset patch
# User sand
# Date 1269367520 -3600
#      Tue Mar 23 19:05:20 2010 +0100
# Branch stable
# Node ID 3327c79c81817eaa1b5b233d768b1c7e63ab0c7d
# Parent  1f15b0fcb6146e58c6c160b707fd9481e8f753b6
reload only validated comment tree for sub-comments instead of reloading the entire comment section

diff --git a/data/cubes.comment.js b/data/cubes.comment.js
--- a/data/cubes.comment.js
+++ b/data/cubes.comment.js
@@ -38,7 +38,11 @@
         d = asyncRemoteExec(funcname, eid, comment, format);
         d.addCallback(function () {
             var rooteid = getNode('commentsectionComponent').getAttribute('cubicweb:rooteid');
-            reloadComponent('commentsection', rql_for_eid(rooteid), 'contentnavigation');
+	    if (rooteid == eid){
+	        reloadComponent('commentsection', rql_for_eid(eid), 'contentnavigation');
+            } else {
+		reloadComponent('tree', rql_for_eid(eid), 'views', 'comment'+eid);
+	    }
         });
     } else { // comment cancelled, close div holding the form
         var comment = jQuery('#comment' + eid + 'Slot');