Project

General

Profile

Bug #17920 » 20071216_clickmenu.patch

Administrator Admin, 2007-12-16 14:17

View differences:

typo3/js/clickmenu.js (working copy)
/**
* extends prototype's Position object
* extends window object to identify the scroll offset of the page
*
* @return an object with a top and a left position property
*/
Position.getScrollOffset = function() {
this.prepare();
return { top: this.deltaY, left: this.deltaX };
window.getScrollOffset = function() {
var l = window.pageXOffset
|| document.documentElement.scrollLeft
|| document.body.scrollLeft
|| 0;
var t = window.pageYOffset
|| document.documentElement.scrollTop
|| document.body.scrollTop
|| 0;
return { top: t, left: l };
}
/**
......
dimsWindow.width = dimsWindow.width-20; // saving margin for scrollbars
var dims = Element.getDimensions(obj); // dimensions for the clickmenu
var offset = Position.getScrollOffset();
var offset = window.getScrollOffset();
var relative = { X: this.mousePos.X - offset.left, Y: this.mousePos.Y - offset.top };
// adjusting the Y position of the layer to fit it into the window frame
(2-2/2)