Changeset 2519
- Timestamp:
- 02/01/2010 12:26:41 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-themes/bp-default/_inc/global.js
r2510 r2519 17 17 } 18 18 19 /* Object filter and scope set. */ 20 var objects = [ 'members', 'groups', 'blogs', 'forums' ]; 21 bp_init_objects( objects ); 22 19 23 /* Hide Forums Post Form */ 20 24 if ( j('div.forums').length ) 21 25 j('div#new-topic-post').hide(); 22 23 /* Object filter and scope set. */24 var objects = [ 'members', 'groups', 'blogs', 'forums' ];25 j(objects).each( function(i) {26 if ( null != j.cookie('bp-' + objects[i] + '-filter') && j('div.' + objects[i]).length )27 j('li#' + objects[i] + '-order-select select option[value=' + j.cookie('bp-' + objects[i] + '-filter') + ']').attr( 'selected', 'selected' );28 29 if ( null != j.cookie('bp-' + objects[i] + '-scope') && j('div.' + objects[i]).length ) {30 j('div.item-list-tabs li').each( function() {31 j(this).removeClass('selected');32 });33 j('div.item-list-tabs li#' + objects[i] + '-' + j.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#object-nav li.current').addClass('selected');34 }35 36 /* Reset the page cookie on reload */37 j.cookie('bp-' + objects[i] + '-page', null);38 });39 26 40 27 /* @mention Compose Scrolling */ … … 995 982 }); 996 983 }); 984 985 /* Setup object scope and filter based on the current cookie settings for the object. */ 986 function bp_init_objects(objects) { 987 j(objects).each( function(i) { 988 if ( null != j.cookie('bp-' + objects[i] + '-filter') && j('div.' + objects[i]).length ) 989 j('li#' + objects[i] + '-order-select select option[value=' + j.cookie('bp-' + objects[i] + '-filter') + ']').attr( 'selected', 'selected' ); 990 991 if ( null != j.cookie('bp-' + objects[i] + '-scope') && j('div.' + objects[i]).length ) { 992 j('div.item-list-tabs li').each( function() { 993 j(this).removeClass('selected'); 994 }); 995 j('div.item-list-tabs li#' + objects[i] + '-' + j.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#object-nav li.current').addClass('selected'); 996 } 997 998 /* Reset the page cookie on reload */ 999 j.cookie('bp-' + objects[i] + '-page', null); 1000 }); 1001 } 997 1002 998 1003 /* Filter the current content list (groups/members/blogs/topics) */
Note: See TracChangeset
for help on using the changeset viewer.