Fix #6464 - card header
[roojs1] / Roo / bootstrap / MenuMgr.js
index 061726a..09970bc 100644 (file)
@@ -42,7 +42,8 @@ Roo.bootstrap.MenuMgr = function(){
    function onHide(m){
        active.remove(m);
        if(active.length < 1){
-           Roo.get(document).un("mousedown", onMouseDown);
+           Roo.get(document).un("mouseup", onMouseDown);
+            
            attached = false;
        }
    }
@@ -53,14 +54,15 @@ Roo.bootstrap.MenuMgr = function(){
        lastShow = new Date();
        active.add(m);
        if(!attached){
-           Roo.get(document).on("mousedown", onMouseDown);
+          Roo.get(document).on("mouseup", onMouseDown);
+           
            attached = true;
        }
        if(m.parentMenu){
-          m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"), 10) + 3);
+          //m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"), 10) + 3);
           m.parentMenu.activeChild = m;
        }else if(last && last.isVisible()){
-          m.getEl().setZIndex(parseInt(last.getEl().getStyle("z-index"), 10) + 3);
+          //m.getEl().setZIndex(parseInt(last.getEl().getStyle("z-index"), 10) + 3);
        }
    }
 
@@ -85,11 +87,17 @@ Roo.bootstrap.MenuMgr = function(){
        }
    }
 
-   // private
+   // private this should really trigger on mouseup..
    function onMouseDown(e){
-       if(lastShow.getElapsed() > 50 && active.length > 0 && !e.getTarget(".x-menu")){
-           hideAll();
-       }
+        Roo.log("on Mouse Up");
+        
+        if(lastShow.getElapsed() > 50 && active.length > 0 && !e.getTarget(".dropdown-menu") && !e.getTarget('.user-menu')){
+            Roo.log("MenuManager hideAll");
+            hideAll();
+            e.stopEvent();
+        }
+        
+        
    }
 
    // private
@@ -150,6 +158,7 @@ Roo.bootstrap.MenuMgr = function(){
                return new Roo.bootstrap.Menu(menu);
            }
            */
+           return false;
        },
 
        // private