From fd0b00330fa9bc920185678b9dac8b97956138c4 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Wed, 30 Sep 2020 15:31:17 -0700 Subject: [PATCH] Don't show cog on Link column, refs #981 Also show ascending option before descending option --- datasette/static/table.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/datasette/static/table.js b/datasette/static/table.js index 75cdd23c..0f50dcf5 100644 --- a/datasette/static/table.js +++ b/datasette/static/table.js @@ -1,8 +1,8 @@ var DROPDOWN_HTML = ``; @@ -63,10 +63,13 @@ var DROPDOWN_ICON_SVG = ` { + ths.forEach(th => { + if (!th.querySelector('a')) { + return; + } var icon = svg.cloneNode(true); icon.addEventListener('click', iconClicked); icon.style.cursor = 'pointer'; - el.appendChild(icon); + th.appendChild(icon); }); })();