Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Jul 14, 2023
1 parent 0472ab9 commit 474f56b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/js/wiki_hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ function cleanText(firstPara) {
}

function calculateHeight(firstPara) {
const paragraph = firstPara ? firstPara.innerText ? firstPara.innerText : firstPara : "";
const height = Math.floor(
firstPara.innerText.split(" ").length / 100
paragraph.split(" ").length / 100
);
if (height < 2) {
return `auto`;
Expand All @@ -65,6 +66,8 @@ try {
theme: "translucent",
followCursor: true,
arrow: false,
touch: "hold",
inlinePositioning: true,
placement: position[Math.floor(Math.random() * position.length - 1)],
onShow(instance) {
fetch(instance.reference.href)
Expand Down

0 comments on commit 474f56b

Please sign in to comment.