diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-06-07 22:40:58 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-06-07 22:40:58 +0000 |
commit | 02e0a58f8907c66a0dbe7241621e5ad0bb264426 (patch) | |
tree | 3b036e8301b5c8d2ea9279ea8a5ea1f4da91519b /mod/riverdashboard/views/default/riverdashboard | |
parent | 4f5e0a8fba1460458bd74fdfc572f0394143c1c2 (diff) | |
download | elgg-02e0a58f8907c66a0dbe7241621e5ad0bb264426.tar.gz elgg-02e0a58f8907c66a0dbe7241621e5ad0bb264426.tar.bz2 |
Minimal attempt to bring riverdashboard up to code standards.
Fixed comment count in +N more string.
Added ajax grabbing of all comments when clicking more link.
git-svn-id: http://code.elgg.org/elgg/trunk@6389 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/riverdashboard/views/default/riverdashboard')
-rw-r--r-- | mod/riverdashboard/views/default/riverdashboard/js.php | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/mod/riverdashboard/views/default/riverdashboard/js.php b/mod/riverdashboard/views/default/riverdashboard/js.php index 1e97a510a..37de3ad04 100644 --- a/mod/riverdashboard/views/default/riverdashboard/js.php +++ b/mod/riverdashboard/views/default/riverdashboard/js.php @@ -8,7 +8,7 @@ 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 }); + myParent.find('.comments_container').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'); @@ -19,16 +19,33 @@ $('.show_comments_button').click(function() { var myParent = $(this).closest('.river_item'); - if (myParent.find('.river_comment').css('display') == 'none') { - // hide comments + if (myParent.find('.comments_container').css('display') == 'none') { + // hide likes 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'); + elgg_slide_toggle(this, '.river_item', '.comments_container'); } }); + // grab more comments + $('.river_show_more_comments').click(function() { + var riverItem = $(this).closest('.river_item'); + var guid = riverItem.attr('id').replace('river_entity_', ''); + var commentsList = riverItem.find('.comments_list'); + var numComments = riverItem.find('.river_comment').length; + + var params = { + 'entity_guid': guid, + 'offset': numComments + } + + $.post('<?php echo $vars['url'];?>mod/riverdashboard/endpoint/get_comments.php', params, function(data) { + commentsList.prepend(data); + commentsList.prev('.river_show_more_comments').hide(); + }); + }); }); </script>
\ No newline at end of file |