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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: randomize comment list #4

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions templates/front.js
Expand Up @@ -2,6 +2,13 @@
( function( $ ) {
var supportForm = $( '#support-container' );

$( document ).ready( function() {
var list_comments = document.querySelector( '.comment-list' );
for ( var i = list_comments.children.length; i >= 0; i-- ) {
list_comments.appendChild(list_comments.children[Math.random() * i | 0]);
}
});

$( '#ac-new-topic' ).on( 'click', function( event ) {
event.preventDefault();

Expand Down