소스 검색

Let's not destroy table on sort

Piotr Czajkowski 4 년 전
부모
커밋
a141bdc235
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      static/processResults.js

+ 1 - 1
static/processResults.js

@@ -45,7 +45,7 @@ app.sortTable = function() {
 
 	// do the work...
 	document.querySelectorAll('th').forEach(th => th.addEventListener('click', (() => {
-		const table = th.closest('table');
+		const table = document.getElementById("dataRows");
 		Array.from(table.querySelectorAll('tr:nth-child(n+2)'))
 			.sort(comparer(Array.from(th.parentNode.children).indexOf(th), this.asc = !this.asc))
 			.forEach(tr => table.appendChild(tr) );