diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-26 09:39:23 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-26 09:39:23 +0900 |
| commit | dbb6c71c5c7098c33824b6070b6526416d3bdd69 (patch) | |
| tree | 56a647059e9f18b62d71a4a774ac66be347e194e /packages/frontend/src/utility | |
| parent | refactor (diff) | |
| download | misskey-dbb6c71c5c7098c33824b6070b6526416d3bdd69.tar.gz misskey-dbb6c71c5c7098c33824b6070b6526416d3bdd69.tar.bz2 misskey-dbb6c71c5c7098c33824b6070b6526416d3bdd69.zip | |
refactor
Diffstat (limited to 'packages/frontend/src/utility')
| -rw-r--r-- | packages/frontend/src/utility/chart-vline.ts | 5 | ||||
| -rw-r--r-- | packages/frontend/src/utility/popout.ts | 4 | ||||
| -rw-r--r-- | packages/frontend/src/utility/sticky-sidebar.ts | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/packages/frontend/src/utility/chart-vline.ts b/packages/frontend/src/utility/chart-vline.ts index 465ca591c6..2fe4bdb83b 100644 --- a/packages/frontend/src/utility/chart-vline.ts +++ b/packages/frontend/src/utility/chart-vline.ts @@ -8,9 +8,10 @@ import type { Plugin } from 'chart.js'; export const chartVLine = (vLineColor: string) => ({ id: 'vLine', beforeDraw(chart, args, options) { - if (chart.tooltip?._active?.length) { + const tooltip = chart.tooltip as any; + if (tooltip?._active?.length) { const ctx = chart.ctx; - const xs = chart.tooltip._active.map(a => a.element.x); + const xs = tooltip._active.map(a => a.element.x); const x = xs.reduce((a, b) => a + b, 0) / xs.length; const topY = chart.scales.y.top; const bottomY = chart.scales.y.bottom; diff --git a/packages/frontend/src/utility/popout.ts b/packages/frontend/src/utility/popout.ts index 5b141222e8..7e0222c459 100644 --- a/packages/frontend/src/utility/popout.ts +++ b/packages/frontend/src/utility/popout.ts @@ -20,8 +20,8 @@ export function popout(path: string, w?: HTMLElement) { } else { const width = 400; const height = 500; - const x = window.top.outerHeight / 2 + window.top.screenY - (height / 2); - const y = window.top.outerWidth / 2 + window.top.screenX - (width / 2); + const x = window.top == null ? 0 : window.top.outerHeight / 2 + window.top.screenY - (height / 2); + const y = window.top == null ? 0 : window.top.outerWidth / 2 + window.top.screenX - (width / 2); window.open(url, url, `width=${width}, height=${height}, top=${x}, left=${y}`); } diff --git a/packages/frontend/src/utility/sticky-sidebar.ts b/packages/frontend/src/utility/sticky-sidebar.ts index 867c9b8324..435555896f 100644 --- a/packages/frontend/src/utility/sticky-sidebar.ts +++ b/packages/frontend/src/utility/sticky-sidebar.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +/* export class StickySidebar { private lastScrollTop = 0; private container: HTMLElement; @@ -53,3 +54,4 @@ export class StickySidebar { this.lastScrollTop = scrollTop <= 0 ? 0 : scrollTop; } } +*/ |