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 remove existing css classes #3

Open
Yoruba opened this issue Feb 17, 2016 · 0 comments
Open

Sorting remove existing css classes #3

Yoruba opened this issue Feb 17, 2016 · 0 comments

Comments

@Yoruba
Copy link

Yoruba commented Feb 17, 2016

Maybe you can add this code to fix the remove existing css classes?
(I'm not a JavaScript developer so maybe there is a better way to fix this.)
Thanks.

            if (that.prevCol === that.column) {
                // if already sorted, reverse
                // th.className = th.className !== 'descend' ? 'descend' : 'ascend';
                th.classList.toggle('ascend');
                th.classList.toggle('descend');
                that.reverseTable();
            }
            else {
                // not sorted - call quicksort
                th.classList.toggle('descend');
                if (that.prevCol !== -1 && that.ths[that.prevCol].className !== 'exc_cell') {
                    // that.ths[that.prevCol].className = '';
                    that.ths[that.prevCol].classList.remove('descend', 'ascend');
                }
                that.quicksort(0, that.trs.length);
            }


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

1 participant