From 75dfbad613765973ded230e3df9d12f18f7916e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P?= Date: Mon, 24 Feb 2020 13:56:15 +0100 Subject: [PATCH 1/3] Update tablesort.js allow empty string as data-sort --- src/tablesort.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tablesort.js b/src/tablesort.js index b52a96b..99aba3f 100644 --- a/src/tablesort.js +++ b/src/tablesort.js @@ -24,7 +24,10 @@ }; var getInnerText = function(el) { - return el.getAttribute('data-sort') || el.textContent || el.innerText || ''; + if(el.haseAttribute('data-sort') { + return el.getAttribute('data-sort'); + } + return el.textContent || el.innerText || ''; }; // Default sort method if no better sort method is found From 3126f6ebdda38267c9c9f04d8568c4baf95eae3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P?= Date: Mon, 24 Feb 2020 13:59:33 +0100 Subject: [PATCH 2/3] Update tablesort.js --- src/tablesort.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tablesort.js b/src/tablesort.js index 99aba3f..2e6b762 100644 --- a/src/tablesort.js +++ b/src/tablesort.js @@ -24,7 +24,7 @@ }; var getInnerText = function(el) { - if(el.haseAttribute('data-sort') { + if(el.haseAttribute('data-sort')) { return el.getAttribute('data-sort'); } return el.textContent || el.innerText || ''; From e09912c97a66a174b11afc5f576c6a17db4eb83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P?= Date: Mon, 24 Feb 2020 14:01:30 +0100 Subject: [PATCH 3/3] Update tablesort.js --- src/tablesort.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tablesort.js b/src/tablesort.js index 2e6b762..f128024 100644 --- a/src/tablesort.js +++ b/src/tablesort.js @@ -24,7 +24,7 @@ }; var getInnerText = function(el) { - if(el.haseAttribute('data-sort')) { + if(el.hasAttribute('data-sort')) { return el.getAttribute('data-sort'); } return el.textContent || el.innerText || '';