More actions
mNo edit summary |
fixed positioning algorithm for tooltip |
||
| Line 165: | Line 165: | ||
frameObj.style.width = maxTooltipWidth + 'px'; | frameObj.style.width = maxTooltipWidth + 'px'; | ||
frameObj.style.left = ((x - parentPos.x) + _posCorrectionX) + 'px'; | frameObj.style.left = ((x - parentPos.x) + _posCorrectionX) + 'px'; | ||
} | } | ||
if((frameObj.offsetWidth + parentPos.x + 70) < windowSize.width) { | |||
frameObj.style.left = ((x - parentPos.x) + _posCorrectionX) + 'px'; | |||
}else { | |||
frameObj.style.left = ((x - parentPos.x) - frameObj.offsetWidth - _posCorrectionX) + 'px'; | |||
} | } | ||
frameObj.style.top = ((y - parentPos.y) + _posCorrectionY) + 'px'; | frameObj.style.top = ((y - parentPos.y) + _posCorrectionY) + 'px'; | ||
} | } | ||