X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=js%2Fdhtmlsuite%2Fmenu-for-applications.js;h=7a7d76e10e4897c75917236c6a90f2112dec221d;hb=65867e61b906045cbd514728b84179c648c98f63;hp=2353dd336eb1496a9809b1c8fba7399e32a220f9;hpb=73c3135236192e3cc34ce33f753a1deeb8bff524;p=kivitendo-erp.git diff --git a/js/dhtmlsuite/menu-for-applications.js b/js/dhtmlsuite/menu-for-applications.js index 2353dd336..7a7d76e10 100644 --- a/js/dhtmlsuite/menu-for-applications.js +++ b/js/dhtmlsuite/menu-for-applications.js @@ -1597,7 +1597,7 @@ DHTMLSuite.menuBar = function() this.targetId = false; this.activeSubItemsOnMouseOver = false; this.menuItemCssPrefix = false; - this.createIframesForOldIeBrowsers = true; + this.createIframesForOldIeBrowsers = false; if(!standardObjectsCreated)DHTMLSuite.createStandardObjects(); @@ -2227,6 +2227,13 @@ DHTMLSuite.menuBar.prototype = { shortRef.style.left = DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement) + 'px'; shortRef.style.top = (DHTMLSuite.commonObj.getTopPos(this.menuItem_objects[parentId].divElement) + this.menuItem_objects[parentId].divElement.offsetHeight) + 'px'; }else{ + var too_large = DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement) + + this.menuItem_objects[parentId].divElement.offsetWidth + + shortRef.offsetWidth + > $('#main_menu_div').width(); + if (too_large) + shortRef.style.left = (DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement) - shortRef.offsetWidth) + 'px'; + else shortRef.style.left = (DHTMLSuite.commonObj.getLeftPos(this.menuItem_objects[parentId].divElement) + this.menuItem_objects[parentId].divElement.offsetWidth) + 'px'; shortRef.style.top = (DHTMLSuite.commonObj.getTopPos(this.menuItem_objects[parentId].divElement)) + 'px'; } @@ -2335,6 +2342,15 @@ DHTMLSuite.menuBar.prototype = { } // }}} , + unsetMenuBarState : function() { this.menuBarState = false }, + changeMenuBarState: function (target) { + var parentId = target.id.replace(/[^0-9]/gi,''); + this.menuBarState = !this.menuBarState; + this.hideSubMenus(); + if(this.menuBarState) { + this.__expandGroup(parentId); + } + }, // {{{ __setBasicEvents() /** * Set basic events for the menu widget. @@ -2344,8 +2360,12 @@ DHTMLSuite.menuBar.prototype = { */ __setBasicEvents : function() { - DHTMLSuite.commonObj.addEvent(document.documentElement,"click",this.hideSubMenus); var menu = this; + $('div.DHTMLSuite_menuBar_sub').click(function() { menu.hideSubMenus(); menu.unsetMenuBarState() }); + $('div.DHTMLSuite_menuBar_top > div > div[objectref!="0"]').click(function() { menu.changeMenuBarState(this) }); + $('div.DHTMLSuite_menuBar_top').click(function(e) { + if ($(e.target).attr('class') == 'DHTMLSuite_menuBar_top') { menu.hideSubMenus(); menu.unsetMenuBarState() } + }); $('#win1').load(function(){ $('#win1').contents().mousedown(function(){ menu.hideSubMenus();