Changeset 7474
- Timestamp:
- 10/24/2013 12:27:41 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-friends/js/widget-friends.min.js
r7394 r7474 1 jQuery(document).ready( function() { 2 jQuery(".widget div#friends-list-options a").on('click', 3 function() { 4 var link = this; 5 jQuery(link).addClass('loading'); 6 7 jQuery(".widget div#friends-list-options a").removeClass("selected"); 8 jQuery(this).addClass('selected'); 9 10 jQuery.post( ajaxurl, { 11 action: 'widget_friends', 12 'cookie': encodeURIComponent(document.cookie), 13 '_wpnonce': jQuery("input#_wpnonce-friends").val(), 14 'max-friends': jQuery("input#friends_widget_max").val(), 15 'filter': jQuery(this).attr('id') 16 }, 17 function(response) 18 { 19 jQuery(link).removeClass('loading'); 20 friend_wiget_response(response); 21 }); 22 23 return false; 24 } 25 ); 26 }); 27 28 function friend_wiget_response(response) { 29 response = response.substr(0, response.length-1); 30 response = response.split('[[SPLIT]]'); 31 32 if ( response[0] != "-1" ) { 33 jQuery(".widget ul#friends-list").fadeOut(200, 34 function() { 35 jQuery(".widget ul#friends-list").html(response[1]); 36 jQuery(".widget ul#friends-list").fadeIn(200); 37 } 38 ); 39 40 } else { 41 jQuery(".widget ul#friends-list").fadeOut(200, 42 function() { 43 var message = '<p>' + response[1] + '</p>'; 44 jQuery(".widget ul#friends-list").html(message); 45 jQuery(".widget ul#friends-list").fadeIn(200); 46 } 47 ); 48 } 49 }
Note: See TracChangeset
for help on using the changeset viewer.