Changeset 83453 in vbox for trunk/src/VBox/ValidationKit/testmanager/htdocs/js
- Timestamp:
- Mar 26, 2020 8:16:05 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/htdocs/js/common.js
r83451 r83453 757 757 var cyNeeded = g_oCurrentTooltip.oElm.offsetHeight + 8; 758 758 759 var cyWindow = window.innerHeight; 759 760 var yScroll = window.pageYOffset || document.documentElement.scrollTop; 760 var yScrollBottom = yScroll + window.innerHeight; 761 var yScrollBottom = yScroll + cyWindow; 762 var cxWindow = window.innerWidth; 761 763 var xScroll = window.pageXOffset || document.documentElement.scrollLeft; 762 var xScrollRight = xScroll + window.innerWidth;763 764 var cyAbove = Math.max(oRelToRect.top - yScroll, 0);765 var cyBelow = Math.max( yScrollBottom- oRelToRect.bottom, 0);766 var cxLeft = Math.max(oRelToRect.left - xScroll, 0);767 var cxRight = Math.max( xScrollRight- oRelToRect.right, 0);764 var xScrollRight = xScroll + cxWindow; 765 766 var cyAbove = Math.max(oRelToRect.top, 0); 767 var cyBelow = Math.max(cyWindow - oRelToRect.bottom, 0); 768 var cxLeft = Math.max(oRelToRect.left, 0); 769 var cxRight = Math.max(cxWindow - oRelToRect.right, 0); 768 770 769 771 var xPos; 770 772 var yPos; 773 774 console.log('tooltipRepositionOnLoad: rect: x,y=' + oRelToRect.x + ',' + oRelToRect.y 775 + ' cx,cy=' + oRelToRect.width + ',' + oRelToRect.height + ' top=' + oRelToRect.top 776 + ' bottom=' + oRelToRect.bottom + ' left=' + oRelToRect.left + ' right=' + oRelToRect.right); 777 //console.log('tooltipRepositionOnLoad: yScroll=' + yScroll + ' yScrollBottom=' + yScrollBottom); 778 //console.log('tooltipRepositionOnLoad: cyAbove=' + cyAbove + ' cyBelow=' + cyBelow + ' cyNeeded=' + cyNeeded); 779 console.log('tooltipRepositionOnLoad: xScroll=' + xScroll + ' xScrollRight=' + xScrollRight); 780 console.log('tooltipRepositionOnLoad: cxLeft=' + cxLeft + ' cxRight=' + cxRight + ' cxNeeded=' + cxNeeded); 771 781 772 782 /* … … 775 785 if (cyNeeded < cyBelow) 776 786 { 777 yPos = oRelToRect.bottom;787 yPos = yScroll + oRelToRect.top; 778 788 g_oCurrentTooltip.cyMax = cyBelow; 789 //console.log('tooltipRepositionOnLoad: #1'); 779 790 } 780 791 else if (cyBelow >= cyAbove) … … 782 793 yPos = yScrollBottom - cyNeeded; 783 794 g_oCurrentTooltip.cyMax = yScrollBottom - yPos; 795 //console.log('tooltipRepositionOnLoad: #2'); 784 796 } 785 797 else 786 798 { 787 yPos = oRelToRect.top- cyNeeded;799 yPos = yScroll + oRelToRect.bottom - cyNeeded; 788 800 g_oCurrentTooltip.cyMax = yScrollBottom - yPos; 801 //console.log('tooltipRepositionOnLoad: #3'); 789 802 } 790 803 if (yPos < yScroll) … … 792 805 yPos = yScroll; 793 806 g_oCurrentTooltip.cyMax = yScrollBottom - yPos; 807 //console.log('tooltipRepositionOnLoad: #4'); 794 808 } 795 809 g_oCurrentTooltip.yPos = yPos; 796 810 g_oCurrentTooltip.yScroll = yScroll; 797 811 g_oCurrentTooltip.cyMaxUp = yPos - yScroll; 798 799 if (cxNeeded < cxRight || cxNeeded > cxRight) 800 { 801 xPos = oRelToRect.right; 812 //console.log('tooltipRepositionOnLoad: yPos=' + yPos + ' yScroll=' + yScroll + ' cyMaxUp=' + g_oCurrentTooltip.cyMaxUp); 813 814 if (cxNeeded < cxRight) 815 { 816 xPos = xScroll + oRelToRect.right; 802 817 g_oCurrentTooltip.cxMax = cxRight; 818 console.log('tooltipRepositionOnLoad: #5'); 803 819 } 804 820 else 805 821 { 806 xPos = oRelToRect.left - cxNeeded; 822 xPos = xScroll + oRelToRect.left - cxNeeded; 823 if (xPos < xScroll) 824 xPos = xScroll; 807 825 g_oCurrentTooltip.cxMax = cxNeeded; 826 console.log('tooltipRepositionOnLoad: #6'); 808 827 } 809 828 g_oCurrentTooltip.xPos = xPos; 810 829 g_oCurrentTooltip.xScroll = xScroll; 830 console.log('tooltipRepositionOnLoad: xPos=' + xPos + ' xScroll=' + xScroll); 811 831 812 832 g_oCurrentTooltip.oElm.style.top = yPos + 'px'; … … 949 969 } 950 970 951 //console.log('cyNeeded='+cyNeeded+' cyMax='+g_oCurrentTooltip.cyMax+' cySpace='+cySpace+' cy='+cy);952 //console.log('oIFrameElement.offsetTop='+oIFrameElement.offsetTop);953 //console.log('svnHistoryTooltipOnLoad: cx='+cx+'cxMax='+g_oCurrentTooltip.cxMax+' cxNeeded='+cxNeeded+' cy='+cy+' cyMax='+g_oCurrentTooltip.cyMax);971 console.log('cyNeeded='+cyNeeded+' cyMax='+g_oCurrentTooltip.cyMax+' cySpace='+cySpace+' cy='+cy); 972 console.log('oIFrameElement.offsetTop='+oIFrameElement.offsetTop); 973 console.log('svnHistoryTooltipOnLoad: cx='+cx+'cxMax='+g_oCurrentTooltip.cxMax+' cxNeeded='+cxNeeded+' cy='+cy+' cyMax='+g_oCurrentTooltip.cyMax); 954 974 955 975 tooltipRepositionOnLoad();
Note:
See TracChangeset
for help on using the changeset viewer.