Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 4 additions & 30 deletions css/elements.css
Original file line number Diff line number Diff line change
Expand Up @@ -1381,43 +1381,17 @@ a.menu-pane-header-production {
overflow-y: auto;
}

li.menu-search-result-clause::before {
content: 'clause';
width: 40px;
display: inline-block;
text-align: right;
padding-right: 1ex;
color: var(--control-dimmed-foreground-color);
font-size: 75%;
}
li.menu-search-result-op::before {
content: 'op';
width: 40px;
display: inline-block;
text-align: right;
padding-right: 1ex;
color: var(--control-dimmed-foreground-color);
font-size: 75%;
}

li.menu-search-result-prod::before {
content: 'prod';
li.menu-search-result::before {
display: none;
width: 40px;
display: inline-block;
text-align: right;
padding-right: 1ex;
color: var(--control-dimmed-foreground-color);
font-size: 75%;
}

li.menu-search-result-term::before {
content: 'term';
width: 40px;
li.menu-search-result[data-kind]::before {
display: inline-block;
text-align: right;
padding-right: 1ex;
color: var(--control-dimmed-foreground-color);
font-size: 75%;
content: attr(data-kind);
}

#menu-search-results ul {
Expand Down
12 changes: 6 additions & 6 deletions js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,30 +187,30 @@ Search.prototype.displayResults = function (results) {
let key = result.key;
let entry = result.entry;
let id = entry.id;
let cssClass = '';
let kind = '';
let text = '';

if (entry.type === 'clause') {
let number = entry.number ? entry.number + ' ' : '';
text = number + key;
cssClass = 'clause';
kind = 'clause';
id = entry.id;
} else if (entry.type === 'production') {
text = key;
cssClass = 'prod';
kind = 'prod';
id = entry.id;
} else if (entry.type === 'op') {
text = key;
cssClass = 'op';
kind = 'op';
id = entry.id || entry.refId;
} else if (entry.type === 'term') {
text = key;
cssClass = 'term';
kind = 'term';
id = entry.id || entry.refId;
}

if (text) {
html += `<li class=menu-search-result-${cssClass}><a href="${makeLinkToId(id)}">${text}</a></li>`;
html += `<li class="menu-search-result"${kind ? ` data-kind="${kind}"` : ''}><a href="${makeLinkToId(id)}">${text}</a></li>`;
}
});

Expand Down
46 changes: 10 additions & 36 deletions test/baselines/generated-reference/assets-inline.html
Original file line number Diff line number Diff line change
Expand Up @@ -271,30 +271,30 @@
let key = result.key;
let entry = result.entry;
let id = entry.id;
let cssClass = '';
let kind = '';
let text = '';

if (entry.type === 'clause') {
let number = entry.number ? entry.number + ' ' : '';
text = number + key;
cssClass = 'clause';
kind = 'clause';
id = entry.id;
} else if (entry.type === 'production') {
text = key;
cssClass = 'prod';
kind = 'prod';
id = entry.id;
} else if (entry.type === 'op') {
text = key;
cssClass = 'op';
kind = 'op';
id = entry.id || entry.refId;
} else if (entry.type === 'term') {
text = key;
cssClass = 'term';
kind = 'term';
id = entry.id || entry.refId;
}

if (text) {
html += `<li class=menu-search-result-${cssClass}><a href="${makeLinkToId(id)}">${text}</a></li>`;
html += `<li class="menu-search-result"${kind ? ` data-kind="${kind}"` : ''}><a href="${makeLinkToId(id)}">${text}</a></li>`;
}
});

Expand Down Expand Up @@ -2996,43 +2996,17 @@
overflow-y: auto;
}

li.menu-search-result-clause::before {
content: 'clause';
width: 40px;
display: inline-block;
text-align: right;
padding-right: 1ex;
color: var(--control-dimmed-foreground-color);
font-size: 75%;
}
li.menu-search-result-op::before {
content: 'op';
width: 40px;
display: inline-block;
text-align: right;
padding-right: 1ex;
color: var(--control-dimmed-foreground-color);
font-size: 75%;
}

li.menu-search-result-prod::before {
content: 'prod';
li.menu-search-result::before {
display: none;
width: 40px;
display: inline-block;
text-align: right;
padding-right: 1ex;
color: var(--control-dimmed-foreground-color);
font-size: 75%;
}

li.menu-search-result-term::before {
content: 'term';
width: 40px;
li.menu-search-result[data-kind]::before {
display: inline-block;
text-align: right;
padding-right: 1ex;
color: var(--control-dimmed-foreground-color);
font-size: 75%;
content: attr(data-kind);
}

#menu-search-results ul {
Expand Down