mirror of
https://github.com/sys-nyx/red-arch.git
synced 2025-05-06 08:45:31 -04:00
initial
This commit is contained in:
commit
d9d000055b
32 changed files with 1530 additions and 0 deletions
37
r/static/js/archive-comments.js
Normal file
37
r/static/js/archive-comments.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
$(document).ready(function() {
|
||||
$('a.score').click(function(){
|
||||
var $comment = $(this).closest('.comment');
|
||||
var depth = parseInt($comment.data('depth'));
|
||||
if ($comment.hasClass('collapsed')) {
|
||||
$comment.removeClass('collapsed');
|
||||
$check_comment = $comment.next('.comment');
|
||||
depth_sibling = false;
|
||||
while (!depth_sibling) {
|
||||
if ($check_comment.length == 0) {
|
||||
depth_sibling = true;
|
||||
}
|
||||
if ($check_comment.data('depth') == '' || parseInt($check_comment.data('depth')) <= depth) {
|
||||
depth_sibling = true;
|
||||
} else {
|
||||
$check_comment.removeClass('hidden');
|
||||
}
|
||||
$check_comment = $check_comment.next('.comment');
|
||||
}
|
||||
} else {
|
||||
$comment.addClass('collapsed');
|
||||
$check_comment = $comment.next('.comment');
|
||||
depth_sibling = false;
|
||||
while (!depth_sibling) {
|
||||
if ($check_comment.length == 0) {
|
||||
depth_sibling = true;
|
||||
}
|
||||
if ($check_comment.data('depth') == '' || parseInt($check_comment.data('depth')) <= depth) {
|
||||
depth_sibling = true;
|
||||
} else {
|
||||
$check_comment.addClass('hidden');
|
||||
}
|
||||
$check_comment = $check_comment.next('.comment');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue