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

natural sorting for isotope #616

Closed
wants to merge 1 commit into from
Closed

Conversation

micred
Copy link

@micred micred commented Jan 31, 2014

Sorting for isotope is by lexicographic order.
This can be odd. Elements ['1_file', '2_file', '20_file'] are sorted in this way:
1_file
20_file
2_file

With this pull request user can be enable natural sorting, i.e.:
1_file
2_file
20_file

Credits: https://github.com/overset/javascript-natural-sort/

Configure:

$element.isotope({
    sortBy : sortName,
    sortAscending: true,
    naturalSorting : true
});

@desandro
Copy link
Member

desandro commented Feb 1, 2014

Thank you for your contribution! 🚀 👄 This looks to be a solid feature that Isotope could use. For now, I'm going to keep it un-merged and wait for others to chime in.

This branch is against master, which is soon to be obsolete. Once v2 is merged in, you may want to revisit this.

@micred
Copy link
Author

micred commented Feb 1, 2014

No problem, I can rework this little patch to v2 branch if you find it useful. Is up to you.

@desandro
Copy link
Member

Closing up this open PR. Thanks again for your contribution!

@desandro desandro closed this Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants