kivitendo rebranding
[kivitendo-erp.git] / js / dhtmlsuite / menu-for-applications.js
index 2fd192a..7a7d76e 100644 (file)
@@ -1597,7 +1597,7 @@ DHTMLSuite.menuBar = function()
        this.targetId = false;\r
        this.activeSubItemsOnMouseOver = false;\r
        this.menuItemCssPrefix = false;\r
-       this.createIframesForOldIeBrowsers = true;\r
+       this.createIframesForOldIeBrowsers = false;\r
        if(!standardObjectsCreated)DHTMLSuite.createStandardObjects();  \r
        \r
        \r
@@ -2343,6 +2343,14 @@ DHTMLSuite.menuBar.prototype = {
        // }}}  \r
        ,\r
     unsetMenuBarState : function() { this.menuBarState = false },\r
+    changeMenuBarState: function (target) {\r
+          var parentId = target.id.replace(/[^0-9]/gi,'');\r
+          this.menuBarState = !this.menuBarState;\r
+       this.hideSubMenus();\r
+          if(this.menuBarState) {\r
+               this.__expandGroup(parentId);\r
+       }\r
+    },\r
        // {{{ __setBasicEvents()\r
     /**\r
      * Set basic events for the menu widget.\r
@@ -2352,9 +2360,12 @@ DHTMLSuite.menuBar.prototype = {
      */        \r
        __setBasicEvents : function()\r
        {\r
-               DHTMLSuite.commonObj.addEvent(document.documentElement,"click",this.hideSubMenus);              \r
         var menu = this;\r
-        $(document).mousedown(function(){ menu.unsetMenuBarState(); });\r
+        $('div.DHTMLSuite_menuBar_sub').click(function() { menu.hideSubMenus(); menu.unsetMenuBarState() });\r
+        $('div.DHTMLSuite_menuBar_top > div > div[objectref!="0"]').click(function() { menu.changeMenuBarState(this) });\r
+        $('div.DHTMLSuite_menuBar_top').click(function(e) {\r
+          if ($(e.target).attr('class') == 'DHTMLSuite_menuBar_top') { menu.hideSubMenus(); menu.unsetMenuBarState() }\r
+        });\r
         $('#win1').load(function(){\r
             $('#win1').contents().mousedown(function(){\r
                 menu.hideSubMenus();\r