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