mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-05 00:45:50 +02:00
refactor
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user