blob: b1bace04a8dcb52439b66daa2a96d6f185fa1514 (
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
35
|
<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>
|