From 474f56bcd81d26c2b5cc9c8b589ee44d7256bd46 Mon Sep 17 00:00:00 2001 From: Mara Date: Fri, 14 Jul 2023 14:19:39 +0200 Subject: [PATCH] adjust --- src/js/wiki_hover.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/wiki_hover.js b/src/js/wiki_hover.js index cf8e757..6cadca2 100644 --- a/src/js/wiki_hover.js +++ b/src/js/wiki_hover.js @@ -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`; @@ -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)