Giter Club home page Giter Club logo

Comments (13)

jjtykkyl avatar jjtykkyl commented on June 25, 2024

Can you paste a code example or (preferably) a link to a CodePen demonstrating the issue so that I could dig into the problem more deeply?

from jquery-comments.

hrmshandy avatar hrmshandy commented on June 25, 2024

You can check this url http://codepen.io/shandy05/pen/EPqeGm, try to reply and reload

from jquery-comments.

jjtykkyl avatar jjtykkyl commented on June 25, 2024

There was a bug indeed when comparing the dates of two comments, this is now fixed in the newest version 1.1.1. The fix was done in: 5a0b13a

from jquery-comments.

hrmshandy avatar hrmshandy commented on June 25, 2024

still not working :(

from jquery-comments.

jjtykkyl avatar jjtykkyl commented on June 25, 2024

Now I got it working in codepen after 5d5bed4. Still, I don't understand why it works after this commit, I think there are some issues in your data. For example, there may be a parent comment that has a timestamp later than one of its replies

from jquery-comments.

hrmshandy avatar hrmshandy commented on June 25, 2024

ok, thanks for help

from jquery-comments.

jjtykkyl avatar jjtykkyl commented on June 25, 2024

Did you get it working after the latest commit?

from jquery-comments.

hrmshandy avatar hrmshandy commented on June 25, 2024

sometimes working, I don't know where is problem

from jquery-comments.

jjtykkyl avatar jjtykkyl commented on June 25, 2024

Unfortunately I don't have time to investigate this issue right now but you can do so if you will. The problem is in sorting the comments at the beginning, line 635:

                comments.sort(function(commentA, commentB) {
                    var createdA = new Date(commentA.created).getTime();
                    var createdB = new Date(commentB.created).getTime();
                    if(sortKey == 'oldest') {
                        return createdB - createdA < 0;
                    } else {
                        return createdB - createdA > 0;
                    }
                });

For some reason the comments are not sorted by date and thus the parent of a certain comment cannot be referenced in the commentsById dictionary.

from jquery-comments.

hrmshandy avatar hrmshandy commented on June 25, 2024

ok, i will try to investigate, thanks jjtykkyl :)

from jquery-comments.

baimurzin avatar baimurzin commented on June 25, 2024

I found the same bug on my own project. Also i figured out that my mistake was I got some comments from server without date and this was the reason, because comments firstly sorted on line 272:
// Sort comments by date (oldest first so that they can be appended to the data model

I removed all comments without date and it works

from jquery-comments.

KG20 avatar KG20 commented on June 25, 2024

Hello, was this problem resolved? Because i tried everything suggested above, and the problem is still coming. I noticed that when i add more than a certain amount of data.. i deleted all the data and tried again, the same problem..I amended the comments-data.js and added one more comment, and it gives the same problem, can that more than 10 comments causes problems or am I doing something wrong? Thanks!

from jquery-comments.

craake avatar craake commented on June 25, 2024

Hi everybody! It's been a while since last post here, but I might have a good news for those who still struggle with this strange bug or will in the future. A bit of a workaround...

When implementing this plugin, make sure to have timeFormatter() function added to your config. It must return time format that include time along date (e.g. G:i M, d Y). That is the only way to have proper loading order of comments, and to avoid missing parent for comment replies.

Hope this will help someone.

from jquery-comments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.