More actions
mNo edit summary |
cancelled the clipboard tool project, added new repositioning algorithm for tooltip display |
||
| Line 153: | Line 153: | ||
var windowSize = getWindowSize(); | var windowSize = getWindowSize(); | ||
if((frameObj.offsetWidth + parentPos.x) < windowSize.width) { | if((frameObj.offsetWidth + parentPos.x + _posCorrectionX) < windowSize.width) { | ||
frameObj.style.left = ((x - parentPos.x) + _posCorrectionX) + 'px'; | frameObj.style.left = ((x - parentPos.x) + _posCorrectionX) + 'px'; | ||
}else { | }else { | ||
var maxTooltipWidth = windowSize.width > 800 ? (0.6 * windowSize.width) : (0.8 * windowSize.width); | |||
if(frameObj.offsetWidth > maxTooltipWidth) | |||
{ | |||
frameObj.style.width = maxTooltipWidth; | |||
} | |||
frameObj.style.left = ((x - parentPos.x) - frameObj.offsetWidth - _posCorrectionX) + 'px'; | frameObj.style.left = ((x - parentPos.x) - frameObj.offsetWidth - _posCorrectionX) + 'px'; | ||
} | } | ||