From 6fc5723a71eb79f4f68ed0afc56a8659e6add6ad Mon Sep 17 00:00:00 2001 From: Josha von Gizycki Date: Fri, 26 Jul 2019 09:10:00 +0200 Subject: [PATCH] fix broken sort --- resources/public/js/scripts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/public/js/scripts.js b/resources/public/js/scripts.js index 6052112..85aff8f 100644 --- a/resources/public/js/scripts.js +++ b/resources/public/js/scripts.js @@ -227,7 +227,7 @@ document.addEventListener('DOMContentLoaded', function () { } function flipSortDir(dir) { - return (dir || 'asc') == 'asc' ? 'desc' : 'asc' + return (dir || 'asc') === 'asc' ? 'desc' : 'asc' } function clearSortAttributes(tbl) { @@ -240,7 +240,7 @@ document.addEventListener('DOMContentLoaded', function () { console.debug(tbl, ix, event) const sortDir = event.target.getAttribute('data-sort') || 'asc' - const sortMod = sortDir == 'asc' ? 1 : -1; + const sortMod = sortDir === 'asc' ? -1 : 1; const rows = tblRows(tbl) const newTbody = document.createElement('tbody')