1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-05 00:45:50 +02:00
This commit is contained in:
syuilo
2025-08-26 09:39:23 +09:00
parent 9e5c8d94bf
commit dbb6c71c5c
8 changed files with 51 additions and 35 deletions

View File

@@ -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;

View File

@@ -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}`);
}

View File

@@ -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;
}
}
*/