Skip to content

Commit

Permalink
Fix tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxwellBo committed Dec 9, 2024
1 parent 44cb7fc commit 8654dba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bibhtml/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@celine/bibhtml",
"version": "1.13.0",
"version": "1.14.0",
"license": "MIT",
"exports": "./mod.ts"
}
6 changes: 3 additions & 3 deletions bibhtml/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ <h2>Installation</h2>
Add the following script to your HTML file's <code>&lt;head&gt;</code> element:
</p>

<div id="installation"><script type="module" src="https://esm.sh/jsr/@celine/bibhtml@1.13.0"></script></div>
<div id="installation"><script type="module" src="https://esm.sh/jsr/@celine/bibhtml@1.14.0"></script></div>

<script id="installation-cell" type="module">
celine.cell("installation", () => {
Expand Down Expand Up @@ -238,9 +238,9 @@ <h3><code>&lt;bh-cite&gt;</code></h3>
</script>

<p>
The <code>deref</code> attribute, achieves a similar goal by <a href="https://en.wikipedia.org/wiki/Indirection"><i>dereferencing</i></a> a citation, setting the <code>href</code> attribute of the inner <code>&lt;a&gt;</code> element by extracting it from the referenced <code>&lt;bh-reference&gt;</code> element.
The <code>deref</code> attribute, achieves a similar goal by <a href="https://en.wikipedia.org/wiki/Indirection"><q>dereferencing</q></a> a citation, setting the <code>href</code> attribute of the inner <code>&lt;a&gt;</code> element to the URL associated with the reference as determined by Citation.js.

Thus, <span id="deref-container"><bh-cite><cite><a href="#mokhov2018" deref>Build Systems à la Carte</a></cite></bh-cite></span> links to <a href="https://doi.org/10.1145/3236774">https://doi.org/10.1145/3236774</a>.
Thus, <span id="deref-container"><bh-cite><cite><a href="#mokhov2018" deref>Build Systems à la Carte</a></cite></bh-cite></span> is <q>dereferenced</q> to link to <a href="https://doi.org/10.1145/3236774">https://doi.org/10.1145/3236774</a>.
</p>

<script id="deref-cell" type="module">
Expand Down
4 changes: 2 additions & 2 deletions bibhtml/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ export class BibhtmlCite extends HTMLElement {
tooltip.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.1)';
tooltip.style.borderRadius = '4px';
tooltip.style.maxWidth = '300px';
tooltip.style.fontSize = '14px';

// Position the tooltip underneath the citation link
const rect = clonedA!.getBoundingClientRect();
tooltip.style.top = `${rect.bottom + globalThis.scrollY}px`;
tooltip.style.left = `${rect.left + globalThis.scrollX}px`;
tooltip.style.left = `${rect.left + globalThis.scrollX + 100}px`;

this.shadowRoot!.appendChild(tooltip);

Expand Down

0 comments on commit 8654dba

Please sign in to comment.