Skip to content

Commit

Permalink
Tooltip wider. Remove debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuess committed Mar 7, 2022
1 parent 966ef76 commit 67ada2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/components/glossarytooltips.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
}
.ui.popup {
hyphens: auto;
width: 15rem;
font-size: 75% !important;
ol {
padding-left: 2rem;
padding-left: 1rem;
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ const TextWithGlossaryTooltips = ({ text }) => {
});
}
result = flatten(result);
console.debug('result', result);

return result.map((el, j) => {
if (el.type === 'text') {
return <span key={j}>{el.val}</span>;
} else {
let idx = glossaryterms.findIndex((variant) => variant.term === el.val);
console.debug('idx', el, idx, glossaryterms[idx]);
let definition = glossaryterms[idx]?.definition || '';
// TODO convert definition to ul
switch (definition.length) {
Expand All @@ -68,9 +66,9 @@ const TextWithGlossaryTooltips = ({ text }) => {
let foo = definition.map((el) => `<li>${el}</li>`).join('');
definition = `<ol>${foo}</ol>`;
}
console.debug('definition', definition);
return (
<Popup
wide
position="bottom left"
trigger={<span className="glossarytooltip">{el.val}</span>}
key={j}
Expand Down

0 comments on commit 67ada2f

Please sign in to comment.