• I have initiated the button in custom place with this:

    bp_follow_add_follow_button(array(
        'leader_id'   => $user_id,
        'follower_id' => bp_loggedin_user_id(),
        'link_class'  => 'btn btn-primary btn-xs'
    ));

    Needed to tweak js file, as I’m out of this scope:

    var profileHeader   = jq("#item-buttons");
    var memberLoop      = jq("#members-list");
    var groupMemberLoop = jq("#member-list"); // groan!

    After clicking the Follow/Unfollow the resulting link doesn’t have previously defined link_class classes.

    Is there a way to fix it?

    https://www.ads-software.com/plugins/buddypress-followers/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author r-a-y

    (@r-a-y)

    Good catch!

    I wasn’t passing the current CSS classes when rendering the button after AJAX.

    I’ve added this as an issue here:
    https://github.com/r-a-y/buddypress-followers/issues/56

    —-

    If you’re out of scope, then you’ll need to write your own JS.

    Just add and customize the following bit to your page:

    jq('#WHATEVER_YOUR_SELECTOR_IS').on("click", ".follow-button a", function() {
    	bp_follow_button_action( jq(this) );
    	return false;
    });
    Thread Starter Slava Abakumov

    (@slaffik)

    Hope #56 will be implemented soon.

    —-

    Yeah, sure – already did that ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ajax doesn't respect link-class param’ is closed to new replies.