Bug #17920 » 20071216_clickmenu.patch
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
|
- « Previous
- 1
- 2
- Next »