Ticket #5206: 5206.01.patch
| File 5206.01.patch, 5.2 KB (added by , 13 years ago) |
|---|
-
bp-templates/bp-legacy/js/buddypress.js
jq(document).ready( function() { 732 732 /* All pagination links run through this function */ 733 733 jq('#buddypress').on( 'click', function(event) { 734 734 var target = jq(event.target); 735 var caller = null; 735 736 736 737 if ( target.hasClass('button') ) 737 738 return true; … … jq(document).ready( function() { 749 750 var css_id = el.attr('id').split( '-' ); 750 751 var object = css_id[0]; 751 752 var search_terms = false; 753 var pagination_id = jq(target).closest('.pagination-links').attr('id'); 752 754 753 755 if ( jq('div.dir-search input').length ) 754 756 search_terms = jq('.dir-search input').val(); … … jq(document).ready( function() { 759 761 var page_number = Number( jq('.pagination span.current').html() ) - 1; 760 762 else 761 763 var page_number = Number( jq(target).html() ); 764 765 if ( pagination_id.indexOf( 'pag-bottom' ) !== -1 ) { 766 var caller = 'pag-bottom'; 767 } 762 768 763 bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope'), 'div.' + object, search_terms, page_number, jq.cookie('bp-' + object + '-extras') );769 bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope'), 'div.' + object, search_terms, page_number, jq.cookie('bp-' + object + '-extras'), caller ); 764 770 765 771 return false; 766 772 } … … function bp_init_objects(objects) { 1363 1369 } 1364 1370 1365 1371 /* Filter the current content list (groups/members/blogs/topics) */ 1366 function bp_filter_request( object, filter, scope, target, search_terms, page, extras ) {1372 function bp_filter_request( object, filter, scope, target, search_terms, page, extras, caller ) { 1367 1373 if ( 'activity' == object ) 1368 1374 return false; 1369 1375 … … function bp_filter_request( object, filter, scope, target, search_terms, page, e 1410 1416 }, 1411 1417 function(response) 1412 1418 { 1413 jq(target).fadeOut( 100, function() { 1414 jq(this).html(response); 1415 jq(this).fadeIn(100); 1416 }); 1419 /* animate to top if called from bottom pagination */ 1420 if ( caller == 'pag-bottom' ) { 1421 var top = jq('#subnav').parent(); 1422 jq('html,body').animate({scrollTop: top.offset().top}, 'slow', function() { 1423 jq(target).fadeOut( 100, function() { 1424 jq(this).html(response); 1425 jq(this).fadeIn(100); 1426 }); 1427 }); 1428 1429 } else { 1430 jq(target).fadeOut( 100, function() { 1431 jq(this).html(response); 1432 jq(this).fadeIn(100); 1433 }); 1434 } 1435 1417 1436 jq('.item-list-tabs li.selected').removeClass('loading'); 1418 1437 }); 1419 1438 } -
bp-themes/bp-default/_inc/global.js
jq(document).ready( function() { 718 718 /* All pagination links run through this function */ 719 719 jq('div#content').click( function(event) { 720 720 var target = jq(event.target); 721 var caller = null; 721 722 722 723 if ( target.hasClass('button') ) 723 724 return true; … … jq(document).ready( function() { 735 736 var css_id = el.attr('id').split( '-' ); 736 737 var object = css_id[0]; 737 738 var search_terms = false; 739 var pagination_id = jq(target).closest('.pagination-links').attr('id'); 738 740 739 741 if ( jq('div.dir-search input').length ) 740 742 search_terms = jq('.dir-search input').val(); … … jq(document).ready( function() { 745 747 var page_number = Number( jq('.pagination span.current').html() ) - 1; 746 748 else 747 749 var page_number = Number( jq(target).html() ); 750 751 if ( pagination_id.indexOf( 'pag-bottom' ) !== -1 ) { 752 var caller = 'pag-bottom'; 753 } 748 754 749 bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope'), 'div.' + object, search_terms, page_number, jq.cookie('bp-' + object + '-extras') );755 bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope'), 'div.' + object, search_terms, page_number, jq.cookie('bp-' + object + '-extras'), caller ); 750 756 751 757 return false; 752 758 } … … function bp_init_objects(objects) { 1342 1348 } 1343 1349 1344 1350 /* Filter the current content list (groups/members/blogs/topics) */ 1345 function bp_filter_request( object, filter, scope, target, search_terms, page, extras ) {1351 function bp_filter_request( object, filter, scope, target, search_terms, page, extras, caller ) { 1346 1352 if ( 'activity' == object ) 1347 1353 return false; 1348 1354 … … function bp_filter_request( object, filter, scope, target, search_terms, page, e 1389 1395 }, 1390 1396 function(response) 1391 1397 { 1392 jq(target).fadeOut( 100, function() { 1393 jq(this).html(response); 1394 jq(this).fadeIn(100); 1395 }); 1398 /* animate to top if called from bottom pagination */ 1399 if ( caller == 'pag-bottom' ) { 1400 var top = jq('#subnav').parent(); 1401 jq('html,body').animate({scrollTop: top.offset().top}, 'slow', function() { 1402 jq(target).fadeOut( 100, function() { 1403 jq(this).html(response); 1404 jq(this).fadeIn(100); 1405 }); 1406 }); 1407 1408 } else { 1409 jq(target).fadeOut( 100, function() { 1410 jq(this).html(response); 1411 jq(this).fadeIn(100); 1412 }); 1413 } 1414 1396 1415 jq('.item-list-tabs li.selected').removeClass('loading'); 1397 1416 }); 1398 1417 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)