#2: further fix first transition, fix wrong position on scrolled document
parent
9bb9a877af
commit
0de72abc3d
|
@ -7,6 +7,7 @@ var tootlipVisible = false;
|
||||||
var tooltipEl = LNVue.$(`<div class="ln-tooltip"></div>`);
|
var tooltipEl = LNVue.$(`<div class="ln-tooltip"></div>`);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function findTooltipData(el){
|
function findTooltipData(el){
|
||||||
let tooltip = null;
|
let tooltip = null;
|
||||||
while (!tooltip)
|
while (!tooltip)
|
||||||
|
@ -18,9 +19,6 @@ function findTooltipData(el){
|
||||||
}
|
}
|
||||||
|
|
||||||
function tooltipShow(ev,tooltip){
|
function tooltipShow(ev,tooltip){
|
||||||
if (!document.body.contains(tooltipEl))
|
|
||||||
document.body.appendChild(tooltipEl);
|
|
||||||
|
|
||||||
tooltipEl.innerText = tooltip.value;
|
tooltipEl.innerText = tooltip.value;
|
||||||
tooltipEl.setAttribute("VISIBLE","");
|
tooltipEl.setAttribute("VISIBLE","");
|
||||||
|
|
||||||
|
@ -32,13 +30,19 @@ function tooltipHide(ev,tooltip){
|
||||||
}
|
}
|
||||||
|
|
||||||
function tooltipMouseOver(ev){
|
function tooltipMouseOver(ev){
|
||||||
|
if (!document.body.contains(tooltipEl)){
|
||||||
|
document.body.appendChild(tooltipEl);
|
||||||
|
LNVue.onidle(()=>{ tooltipMouseOver(ev);});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let tooltip = findTooltipData(ev.target);
|
let tooltip = findTooltipData(ev.target);
|
||||||
if (!tooltip)
|
if (!tooltip)
|
||||||
console.log(ev);
|
console.log(ev);
|
||||||
|
|
||||||
if (tooltipEl){
|
if (tooltipEl){
|
||||||
tooltipEl.style.left = `${ev.x+3}px`;
|
tooltipEl.style.left = `${ev.pageX+3}px`;
|
||||||
tooltipEl.style.top = `${ev.y+3}px`;
|
tooltipEl.style.top = `${ev.pageY+3}px`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tooltip.timeout)
|
if (tooltip.timeout)
|
||||||
|
|
Loading…
Reference in New Issue