WordPress.org

Forums

BuddyPress Like
Multiple instances of ajax call triggered (12 posts)

  1. colabsadmin
    Member
    Posted 1 year ago #

    ... when clicking 'view likes', 'hide likes'. I didnt take the time to disable my theme, so maybe that's the issue. But I changed "on" click to "live" click in the .view-likes call located in bp-like.min.js to fix issue.

    http://wordpress.org/plugins/buddypress-like/

  2. darrenmeehan
    Member
    Plugin Author

    Posted 1 year ago #

    I'll be removing bits of this code so I don't think this is too much of an issue. I couldn't figure out some of the problems with the ajax, so thanks a million!

  3. darrenmeehan
    Member
    Plugin Author

    Posted 1 year ago #

    I've reworked a lot of the jQuery code, will have it out in next update. I haven't uploaded it yet as I don't want people installing a totally broken plugin!

  4. colabsadmin
    Member
    Posted 1 year ago #

    Thanks!

  5. colabsadmin
    Member
    Posted 1 year ago #

    Quick question. What's the reason for removing "view likes"? I'm still testing so I don't have a post that has more than a few likes, but what if there are 100s of likes (or even 25 for that matter)? Listing all of them by default is going to take up a ton of real-estate. Are you only listing a certain number of them and adding a 'view more' or something?

  6. darrenmeehan
    Member
    Plugin Author

    Posted 1 year ago #

    The way I plan on building it is to show the last two or three people to like something, and then showing the number of others. Like so: "darrenmeehan, colabsadmin and 6 others liked this." With "6 others" being a link to display everyone who liked the post probably in a small pop up.

    It's a lot like how Facebook does it, though I think it makes sense for BuddyPress too.

  7. colabsadmin
    Member
    Posted 1 year ago #

    Excellent. Thanks

  8. darrenmeehan
    Member
    Plugin Author

    Posted 1 year ago #

    Oh and I forgot to mention I'm planning for it to be the last two people to like a post, so it's always showing new people. Having the same people show up even after 100 likes would be pointless!

    If anyone has suggestions on this it would be great.

  9. colabsadmin
    Member
    Posted 1 year ago #

    That sounds perfect. I found some issues with it at the moment, but since you're working on it, I've held of reporting it until the update comes out. Thanks again!

  10. darrenmeehan
    Member
    Plugin Author

    Posted 1 year ago #

    I've the update out not, but please post away at any issues you find!

  11. colabsadmin
    Member
    Posted 1 year ago #

    The new code is spawning a bunch of ajax calls again. It doubles the call with every click. First click makes two calls. The second click makes 4 calls. The third click makes 8 calls.

  12. colabsadmin
    Member
    Posted 1 year ago #

    Okay. I removed the jQuery(document).ajaxComplete(bp_like); line of code in bp-like-min.js and it has resolved the issue. But I'm not sure if it breaks anything else. Here are before and after screen shots of firebug. Note that I click 3 different like/unlike buttons. You can see all the requests is spawned (i was also printing out the button class and id to the console so I could see what was going on.)

    before change
    https://24.media.tumblr.com/058423aaaf0131e0408c1bb148ec1bc4/tumblr_n29zi8DRvb1squolvo1_1280.jpg

    after change (i actually clicked 5 buttons on this one)
    https://31.media.tumblr.com/275032f3934524a2ab53cf6fc90f44ba/tumblr_n29zi8DRvb1squolvo2_1280.jpg

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BuddyPress Like
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.