Changeset 2266
- Timestamp:
- 01/06/2010 12:07:27 PM (15 years ago)
- Location:
- trunk/bp-themes/bp-default
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-themes/bp-default/_inc/css/default.css
r2265 r2266 481 481 -webkit-border-top-right-radius: 3px; 482 482 } 483 div.item-list-tabsul li.loading a {483 ul li.loading a { 484 484 background-image: url( ../images/ajax-loader.gif ); 485 485 background-position: 92% 50%; -
trunk/bp-themes/bp-default/_inc/global.js
r2264 r2266 107 107 }); 108 108 109 /* Activity filter select */ 109 110 j('#activity-filter-select select').change( function() { 110 111 var selected_tab = j( '.' + j(this).parent().parent().parent().attr('class') + ' li.selected'); … … 247 248 j('div.item-list-tabs li.selected, div.item-list-tabs li.current').removeClass('loading'); 248 249 250 /* Selectively hide comments */ 251 bp_dtheme_hide_comments(); 252 249 253 }, 'json' ); 250 254 } … … 254 258 /* Hide all activity comment forms */ 255 259 j('form.ac-form').hide(); 260 261 /* Hide excess comments */ 262 if ( j('div.activity-comments').length ) 263 bp_dtheme_hide_comments(); 256 264 257 265 /* Activity list event delegation */ … … 346 354 ); 347 355 j( 'form#' + form + ' textarea').val(''); 356 357 /* Increase the "Reply (X)" button count */ 358 j('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( j('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 ); 348 359 349 360 /* Re-enable the submit button after 5 seconds. */ … … 389 400 comment_li.parent().append( children.html() ).hide().fadeIn( 200 ); 390 401 }); 402 403 /* Decrease the "Reply (X)" button count */ 404 var parent_li = comment_li.parents('ul#activity-stream > li'); 405 j('li#' + parent_li.attr('id') + ' a.acomment-reply span').html( j('li#' + parent_li.attr('id') + ' a.acomment-reply span').html() - 1 ); 391 406 } 392 407 }); 408 409 return false; 410 } 411 412 /* Showing hidden comments - pause for half a second */ 413 if ( target.parent().hasClass('show-all') ) { 414 target.parent().addClass('loading'); 415 416 setTimeout( function() { 417 target.parent().parent().children('li').fadeIn(200, function() { 418 target.parent().remove(); 419 }); 420 }, 600 ); 393 421 394 422 return false; … … 419 447 } 420 448 }); 449 450 function bp_dtheme_hide_comments() { 451 var comments_divs = j('div.activity-comments'); 452 453 if ( !comments_divs.length ) 454 return false; 455 456 comments_divs.each( function() { 457 if ( j(this).children('ul').children('li').length < 5 ) return; 458 459 var comments_div = j(this); 460 var parent_li = comments_div.parents('ul#activity-stream > li'); 461 var comment_lis = j(this).children('ul').children('li'); 462 463 comment_lis.each( function(i) { 464 /* Show the latest 5 root comments */ 465 if ( i < comment_lis.length - 5 ) { 466 j(this).addClass('hidden'); 467 j(this).toggle(); 468 469 if ( !i ) 470 j(this).before( '<li class="show-all"><a href="#' + parent_li.attr('id') + '/show-all/" title="Show all comments for this thread">Show all ' + j('li#' + parent_li.attr('id') + ' a.acomment-reply span').html() + ' comments</a></li>' ); 471 } 472 }); 473 474 }); 475 } 421 476 422 477 /**** Directory Search ****************************************************/ -
trunk/bp-themes/bp-default/activity/entry.php
r2265 r2266 11 11 <div class="activity-meta"> 12 12 <?php if ( is_user_logged_in() && bp_activity_can_comment() ) : ?> 13 <a href="#acomment-<?php bp_activity_id() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Reply', 'buddypress' ) ?> (< ?php bp_activity_comment_count() ?>)</a>13 <a href="#acomment-<?php bp_activity_id() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Reply', 'buddypress' ) ?> (<span><?php bp_activity_comment_count() ?></span>)</a> 14 14 <?php endif; ?> 15 15
Note: See TracChangeset
for help on using the changeset viewer.