From: Benni Mack Date: Sun, 16 Dec 2007 16:14:54 +0000 (+0000) Subject: Fixed #6955: fileadmin contextual menu doesn't popup well X-Git-Tag: TYPO3_4-2-0alpha3~64 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/020677da75dccbc161fe9845d8479d09e9d44473 Fixed #6955: fileadmin contextual menu doesn't popup well git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2842 709f56b5-9817-0410-a4d7-c38de5d9e867 --- diff --git a/ChangeLog b/ChangeLog index 1f1d4baf2bfa..4fd78b5ffa87 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-12-16 Benjamin Mack + + * (bugfix) #6955: fileadmin contextual menu doesn't popup well + 2007-12-16 Ingo Renner * removed width css property from workspace selector toolbar item as it caused layout issues in non english backends diff --git a/typo3/js/clickmenu.js b/typo3/js/clickmenu.js index 228e55b6cd48..d554a364a1de 100644 --- a/typo3/js/clickmenu.js +++ b/typo3/js/clickmenu.js @@ -37,13 +37,20 @@ window.getDimensions = function() { /** - * extends prototype's Position object + * extends the 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 }; } /** @@ -124,7 +131,7 @@ var Clickmenu = { 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 @@ -143,8 +150,7 @@ var Clickmenu = { x -= (dims.width - 10); } else if ((dimsWindow.width - dims.width - relative.X) < offset.left) { x = offset.left; - } - else { + } else { x += (dimsWindow.width - dims.width - relative.X); } } @@ -158,6 +164,7 @@ var Clickmenu = { } }, + /** * event handler function that saves the actual position of the mouse * in the Clickmenu object