mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Don't show cog on Link column, refs #981
Also show ascending option before descending option
This commit is contained in:
parent
97c71c3a3b
commit
fd0b00330f
1 changed files with 6 additions and 3 deletions
|
|
@ -1,8 +1,8 @@
|
||||||
var DROPDOWN_HTML = `<div class="dropdown-menu">
|
var DROPDOWN_HTML = `<div class="dropdown-menu">
|
||||||
<div class="hook"></div>
|
<div class="hook"></div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a class="dropdown-sort-desc" href="#">Sort descending</a></li>
|
|
||||||
<li><a class="dropdown-sort-asc" href="#">Sort ascending</a></li>
|
<li><a class="dropdown-sort-asc" href="#">Sort ascending</a></li>
|
||||||
|
<li><a class="dropdown-sort-desc" href="#">Sort descending</a></li>
|
||||||
<li><a class="dropdown-facet" href="#">Facet by this</a></li>
|
<li><a class="dropdown-facet" href="#">Facet by this</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
@ -63,10 +63,13 @@ var DROPDOWN_ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" width="14" heig
|
||||||
document.body.appendChild(menu);
|
document.body.appendChild(menu);
|
||||||
|
|
||||||
var ths = Array.from(document.querySelectorAll('.rows-and-columns th'));
|
var ths = Array.from(document.querySelectorAll('.rows-and-columns th'));
|
||||||
ths.forEach(el => {
|
ths.forEach(th => {
|
||||||
|
if (!th.querySelector('a')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var icon = svg.cloneNode(true);
|
var icon = svg.cloneNode(true);
|
||||||
icon.addEventListener('click', iconClicked);
|
icon.addEventListener('click', iconClicked);
|
||||||
icon.style.cursor = 'pointer';
|
icon.style.cursor = 'pointer';
|
||||||
el.appendChild(icon);
|
th.appendChild(icon);
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue