From cf1b1314036aaf1bcfa64a404782f5c649a5c526 Mon Sep 17 00:00:00 2001 From: Joshua Sigona Date: Tue, 10 Aug 2021 22:35:50 +0900 Subject: [PATCH 1/2] Prevent tooltip from drifting outside window --- src/TestPanel.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/TestPanel.js b/src/TestPanel.js index b9f396d..6bdf7ad 100644 --- a/src/TestPanel.js +++ b/src/TestPanel.js @@ -70,13 +70,26 @@ function PageControl(p) { for (var i=0;i) } + console.log(JSON.stringify(p.children)) + if (p.children) { +
  • {p.children}
  • + } return pages.length>0&& } function ExpandTooltip(p) { - return <>{p.children}{p.tooltip} + return <>{p.children} { + const d = document.documentElement; + left = Math.min(d.clientWidth - node.clientWidth, left); + top = Math.min(d.clientHeight - node.clientHeight, top); + left = Math.max(0, left); + top = Math.max(0, top); + return { top, left } +} }>{p.tooltip} } function Class(p) { @@ -433,7 +446,7 @@ useEffect(()=>{

    Damage Stats

    - + Testing {statPage===1?<> From bb6aeda80aded1de2043c6f4998286a8c5ae3db6 Mon Sep 17 00:00:00 2001 From: Joshua Sigona Date: Tue, 10 Aug 2021 22:43:15 +0900 Subject: [PATCH 2/2] cause dudley said so --- src/TestPanel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TestPanel.js b/src/TestPanel.js index 6bdf7ad..afc9220 100644 --- a/src/TestPanel.js +++ b/src/TestPanel.js @@ -70,10 +70,10 @@ function PageControl(p) { for (var i=0;i) } - console.log(JSON.stringify(p.children)) - if (p.children) { -
  • {p.children}
  • + if (p.children!==undefined) { + pages.push(
  • {p.children}
  • ) } + //console.log(JSON.stringify(p.children)) return pages.length>0&&
      {pages.map((page,i)=>{return {page}})}
    @@ -446,7 +446,7 @@ useEffect(()=>{

    Damage Stats

    - Testing +
    {statPage===1?<>