Skip to content

Commit 6a039c3

Browse files
authored
Make categories links (#1152)
* Mkae buttons links * Linting * More linting
1 parent 913c4c5 commit 6a039c3

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

src/js/components/drilldownHeader.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,18 @@ function setCategories(categories) {
2222
const _categories = categories.slice(0,5);
2323
_categories.forEach((category) => {
2424
const cellTemplate = document.createElement('li');
25-
cellTemplate.className = 'cell';
26-
cellTemplate.textContent = category;
25+
cellTemplate.className = 'cell btn';
26+
const link = document.createElement('a');
27+
link.textContent = category;
28+
const urlParams = new URLSearchParams(window.location.search);
29+
urlParams.set('category', category);
30+
const tech = urlParams.get('tech');
31+
if (tech) {
32+
urlParams.delete('tech');
33+
urlParams.set('selected', tech);
34+
}
35+
link.href=`/reports/techreport/category?${urlParams.toString()}`;
36+
cellTemplate.appendChild(link);
2737
list.appendChild(cellTemplate);
2838
});
2939

static/css/techreport/techreport.css

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ nav {
401401
.skip {
402402
position: absolute;
403403
z-index: 999;
404-
clip: rect(0 0 0 0);
405404
clip-path: inset(50%);
406405
height: 1px;
407406
overflow: hidden;
@@ -411,7 +410,6 @@ nav {
411410
}
412411

413412
.skip:focus-visible {
414-
clip: unset;
415413
clip-path: unset;
416414
width: unset;
417415
height: unset;
@@ -1587,6 +1585,19 @@ select {
15871585
border-radius: 1rem;
15881586
border: 1px solid var(--color-text);
15891587
font-size: 0.875rem;
1588+
display:flex;
1589+
margin-right: 0;
1590+
}
1591+
1592+
.intro .categories .cell:has(a) {
1593+
padding: 0;
1594+
}
1595+
1596+
.intro .categories .cell a {
1597+
padding: 0.5rem 0.75rem;
1598+
flex-grow: 1;
1599+
text-decoration: none;
1600+
color: inherit;
15901601
}
15911602

15921603
.page-content {

0 commit comments

Comments
 (0)