Always show actions when there is only a single term result
This commit is contained in:
parent
6c344b2740
commit
9abfd7acde
@ -233,7 +233,7 @@ button.action-button {
|
|||||||
border-top-style: solid;
|
border-top-style: solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry[data-type=term][data-multi-expression=true] .actions>.action-play-audio {
|
.entry[data-type=term][data-expression-multi=true]:not([data-expression-count="1"]) .actions>.action-play-audio {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,11 +280,11 @@ button.action-button {
|
|||||||
content: "\3001";
|
content: "\3001";
|
||||||
}
|
}
|
||||||
|
|
||||||
.term-expression-list[data-multi=true] .term-expression-details {
|
.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression-details {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.term-expression-list[data-multi=true] .term-expression-details {
|
.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression-details {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 0;
|
width: 0;
|
||||||
@ -292,21 +292,21 @@ button.action-button {
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.term-expression-list[data-multi=true] .term-expression:hover .term-expression-details {
|
.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression:hover .term-expression-details {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.term-expression-list[data-multi=true] .term-expression-details>.action-play-audio {
|
.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression-details>.action-play-audio {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
bottom: 0.5em;
|
bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.term-expression-list[data-multi=true] .term-expression-details>.action-play-audio {
|
.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression-details>.action-play-audio {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.term-expression-list[data-multi=true] .term-expression-details>.tags {
|
.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression-details>.tags {
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
@ -314,7 +314,7 @@ button.action-button {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.term-expression-list[data-multi=true] .term-expression-details>.frequencies {
|
.term-expression-list[data-multi=true]:not([data-count="1"]) .term-expression-details>.frequencies {
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
@ -63,11 +63,13 @@ class DisplayGenerator {
|
|||||||
const definitionsContainer = node.querySelector('.term-definition-list');
|
const definitionsContainer = node.querySelector('.term-definition-list');
|
||||||
const debugInfoContainer = node.querySelector('.debug-info');
|
const debugInfoContainer = node.querySelector('.debug-info');
|
||||||
|
|
||||||
const multiExpression = Array.isArray(details.expressions);
|
const expressionMulti = Array.isArray(details.expressions);
|
||||||
const multiDefinition = Array.isArray(details.definitions);
|
const definitionMulti = Array.isArray(details.definitions);
|
||||||
|
|
||||||
node.dataset.multiExpression = `${multiExpression}`;
|
node.dataset.expressionMulti = `${expressionMulti}`;
|
||||||
node.dataset.multiDefinition = `${multiDefinition}`;
|
node.dataset.definitionMulti = `${definitionMulti}`;
|
||||||
|
node.dataset.expressionCount = `${expressionMulti ? details.expressions.length : 1}`;
|
||||||
|
node.dataset.definitionCount = `${definitionMulti ? details.definitions.length : 1}`;
|
||||||
|
|
||||||
DisplayGenerator._appendMultiple(expressionsContainer, this.createTermExpression.bind(this), details.expressions, [details]);
|
DisplayGenerator._appendMultiple(expressionsContainer, this.createTermExpression.bind(this), details.expressions, [details]);
|
||||||
DisplayGenerator._appendMultiple(reasonsContainer, this.createTermReason.bind(this), details.reasons);
|
DisplayGenerator._appendMultiple(reasonsContainer, this.createTermReason.bind(this), details.reasons);
|
||||||
|
Loading…
Reference in New Issue
Block a user