Javascriptmenü nicht nach rechts aus dem Bildschirm fallen lassen.
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 21 Feb 2012 18:19:44 +0000 (19:19 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 21 Feb 2012 18:19:44 +0000 (19:19 +0100)
js/dhtmlsuite/menu-for-applications.js

index 7896f91..2fd192a 100644 (file)
@@ -2227,6 +2227,13 @@ DHTMLSuite.menuBar.prototype = {
                                shortRef.style.left = DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement) + 'px';\r
                                shortRef.style.top = (DHTMLSuite.commonObj.getTopPos(this.menuItem_objects[parentId].divElement) + this.menuItem_objects[parentId].divElement.offsetHeight) + 'px';\r
                        }else{\r
+              var too_large = DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement)\r
+                            + this.menuItem_objects[parentId].divElement.offsetWidth\r
+                            + shortRef.offsetWidth\r
+                            > $('#main_menu_div').width();\r
+              if (too_large)\r
+                shortRef.style.left = (DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement) - shortRef.offsetWidth) + 'px';\r
+              else\r
                                shortRef.style.left = (DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement) + this.menuItem_objects[parentId].divElement.offsetWidth) + 'px';\r
                                shortRef.style.top = (DHTMLSuite.commonObj.getTopPos(this.menuItem_objects[parentId].divElement)) + 'px';               \r
                        }       \r