Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting breaks when listObj is created from .js file #441

Closed
justincorrigible opened this issue Aug 17, 2016 · 3 comments
Closed

Sorting breaks when listObj is created from .js file #441

justincorrigible opened this issue Aug 17, 2016 · 3 comments

Comments

@justincorrigible
Copy link

It's such an odd bug and I haven't been able to figure out why it happens, but when you do

var listObj = new List('whatever', options);

from an included file rather than inside a script tag inside the same html file, the sort buttons only work the first time. When clicked afterwards said button doesn't toggle the list to the opposite order. Any ideas why?

@cscuderi
Copy link

I had something similar happen to me. What was happening was the sort was being toggled twice on click. I was able to track down where the second sort was happening and remove it. Are the classes (asc and desc) being added to the sort button when it's clicked?

@justincorrigible
Copy link
Author

No, it doesn't change the class at all, it seems. It's very strange... however, I did notice the JS external file is being loaded twice (thanks to rails stupid way of handling assets), which would load the var listObj twice. But that by itself should not cause such a weird glitch, specifically with sorting... everything else works just fine.

@javve
Copy link
Owner

javve commented Oct 15, 2016

This seems like a duplicate of #316
I'll have a look at that bug!

@javve javve closed this as completed Oct 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants