blob: 1e97a510a46f7c77d9b06d6cf65181cb3a03acd2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
<script type="text/javascript">
$(document).ready(function() {
$('.river_comment_form_button').click(function() {
elgg_slide_toggle(this, '.river_item', '.river_comment_form');
});
$('.likes_user_list_button').click(function() {
var myParent = $(this).closest('.river_item');
if (myParent.find('.likes_list').css('display') == 'none') {
// hide comments
myParent.find('.river_comment').animate({"height": "toggle", "opacity": "toggle"}, { duration: 400 });
// change selected tab
myParent.find('.show_comments_button').addClass('off');
myParent.find('.likes_user_list_button').removeClass('off');
// show users that liked object
elgg_slide_toggle(this, '.river_item', '.likes_list');
}
});
$('.show_comments_button').click(function() {
var myParent = $(this).closest('.river_item');
if (myParent.find('.river_comment').css('display') == 'none') {
// hide comments
myParent.find('.likes_list').animate({"height": "toggle", "opacity": "toggle"}, { duration: 400 });
// change selected tab
myParent.find('.show_comments_button').removeClass('off');
myParent.find('.likes_user_list_button').addClass('off');
// show users that liked object
elgg_slide_toggle(this, '.river_item', '.river_comment');
}
});
});
</script>
|