Fixed bug #6831: Clickmenu is cut off on the left, when it does not fit in the viewpo...
authorWolfgang Klinger <wolfgang@stufenlos.net>
Mon, 26 Nov 2007 08:54:40 +0000 (08:54 +0000)
committerWolfgang Klinger <wolfgang@stufenlos.net>
Mon, 26 Nov 2007 08:54:40 +0000 (08:54 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2771 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/js/clickmenu.js

index 8868d45..d0fcbf2 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-26  Wolfgang Klinger <wk@plan2.net> 
+
+       * Fixed bug #6831: Clickmenu is cut off on the left, when it does not fit in the viewport (Thanks to Helmut Hummel)
+
 2007-11-25  Ingmar Schlecht  <ingmar@typo3.org>
 
        * Reformatted t3editor sysext
index d29a6ef..228e55b 100644 (file)
@@ -137,11 +137,14 @@ var Clickmenu = {
                                        y += (dimsWindow.height - dims.height - relative.Y);
                                }
                        }
-                       // adjusting the X position like Y above
+                       // adjusting the X position like Y above, but align it to the left side of the viewport if it does not fit completely
                        if (dimsWindow.width - dims.width < relative.X) {
                                if (relative.X > dims.width) {
                                        x -= (dims.width - 10);
-                               } else {
+                               } else if ((dimsWindow.width - dims.width - relative.X) < offset.left) {
+                                       x = offset.left;
+                               }
+                               else {
                                        x += (dimsWindow.width - dims.width - relative.X);
                                }
                        }