tsorter icon indicating copy to clipboard operation
tsorter copied to clipboard

Sorting remove existing css classes

Open Yoruba opened this issue 9 years ago • 0 comments

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);
            }


Yoruba avatar Feb 17 '16 07:02 Yoruba