diff options
author | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-07 14:10:51 +0000 |
---|---|---|
committer | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-07 14:10:51 +0000 |
commit | 538a22b85384008533aeef2ac356ff668766e0cb (patch) | |
tree | 0070a18c9d09241a15df94fcbeeeda16feed4138 /mod/riverdashboard/views/default/riverdashboard/js.php | |
parent | 90cb880ec6b629376df97c89bc4a0b3e2db32c8e (diff) | |
download | elgg-538a22b85384008533aeef2ac356ff668766e0cb.tar.gz elgg-538a22b85384008533aeef2ac356ff668766e0cb.tar.bz2 |
Riverdashboard refreshed, and updated display of comments and likes (the loading of these needs to be moved to ajax callbacks)
git-svn-id: http://code.elgg.org/elgg/trunk@5643 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/riverdashboard/views/default/riverdashboard/js.php')
-rw-r--r-- | mod/riverdashboard/views/default/riverdashboard/js.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/mod/riverdashboard/views/default/riverdashboard/js.php b/mod/riverdashboard/views/default/riverdashboard/js.php index ad96a6069..b1bace04a 100644 --- a/mod/riverdashboard/views/default/riverdashboard/js.php +++ b/mod/riverdashboard/views/default/riverdashboard/js.php @@ -1,7 +1,35 @@ <script type="text/javascript"> $(document).ready(function() { $('.river_comment_form_button').click(function() { - $(this).next('.river_comment_form').toggle(); + 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>
\ No newline at end of file |