fix spot tooltips
Этот коммит содержится в:
родитель
a95ee44d0a
Коммит
b702d8a762
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
@ -1,7 +1,7 @@
|
|||||||
import SpotTooltip from '../components/SpotTooltip.svelte';
|
import SpotTooltip from '../components/SpotTooltip.svelte';
|
||||||
import { get } from 'svelte/store';
|
import { get } from 'svelte/store';
|
||||||
|
|
||||||
export function spottooltipable(node, { data, target, left, top }) {
|
export function spottooltipable(node, { data, target, top }) {
|
||||||
let component;
|
let component;
|
||||||
|
|
||||||
function handleMouseleave(e) {
|
function handleMouseleave(e) {
|
||||||
@ -12,10 +12,10 @@ export function spottooltipable(node, { data, target, left, top }) {
|
|||||||
function handleMouseenter(e) {
|
function handleMouseenter(e) {
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
|
|
||||||
const elem = get(target);
|
const { left } = node.getBoundingClientRect();
|
||||||
|
|
||||||
component = new SpotTooltip({
|
component = new SpotTooltip({
|
||||||
target: elem,
|
target,
|
||||||
props: {
|
props: {
|
||||||
data,
|
data,
|
||||||
x: left,
|
x: left,
|
||||||
|
|||||||
@ -49,7 +49,7 @@
|
|||||||
.spot-tooltip {
|
.spot-tooltip {
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 10000;
|
z-index: 1000000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<g class="spot"
|
<g class="spot"
|
||||||
transform="translate({$x} 0)"
|
transform="translate({$x} 0)"
|
||||||
use:spottooltipable={{data: spot, target: drawWrapper, left: $x, top: $panelHeight + 20}}>
|
use:spottooltipable={{data: spot, target: $drawWrapper, top: $panelHeight + 20}}>
|
||||||
<circle cx="0" cy="0" r="5"></circle>
|
<circle cx="0" cy="0" r="5"></circle>
|
||||||
<circle class="bait" cx="0" cy="0" r="10"></circle>
|
<circle class="bait" cx="0" cy="0" r="10"></circle>
|
||||||
</g>
|
</g>
|
||||||
|
|||||||
Загрузка…
x
Ссылка в новой задаче
Block a user