This is Part 2 of Threaded Comments Functionality.
Part 1 is a Prerequisite of Part 2.
Real Time Commenting System | Part 1
You will be able to show and hide the all the sub-comments just on a double click.
This feature is added just by creating one additional function.
expandCollapse()
id of the item which is double clicked is stored in a variable
data of the repeater is stored in commentData variable
index of selected item is found using findIndex()
all the comments with depth greater than the element which is double clicked are stored in itemIdArr using for loop
all the sub comments collapse if they were expanded and expand if they were collapsed

- Priyanka Verma