Browse Source

导航栏菜单交互逻辑优化

zhuth 7 years ago
parent
commit
6cea3689f0
1 changed files with 12 additions and 10 deletions
  1. 12 10
      frontend/saas-web/app/view/main/Navigation.js

+ 12 - 10
frontend/saas-web/app/view/main/Navigation.js

@@ -124,16 +124,18 @@ Ext.define('saas.view.main.Navigation', {
                         });
 
                         view.el.dom.addEventListener('mouseleave', function (e) {
-                            var ex = e.clientX,
-                                ey = e.clientY,
-                                box = menuView.getBoundingClientRect(),
-                                navItem = menu.navItem,
-                                navBox = navItem.getBoundingClientRect();
-
-                            if (ey <= box.top || ex >= (box.left + box.width) || ey >= (box.top + box.height) || (ex <= box.left && (ey <= navBox.top || ey >= (navBox.top + navBox.height)))) {
-                                menu.navItem.classList.remove(menu.navView.overItemCls);
-                                menu.hide();
-                            }
+                            menu.navItem.classList.remove(menu.navView.overItemCls);
+                            menu.hide();
+                            // var ex = e.clientX,
+                            //     ey = e.clientY,
+                            //     box = menuView.getBoundingClientRect(),
+                            //     navItem = menu.navItem,
+                            //     navBox = navItem.getBoundingClientRect();
+
+                            // if ((ex <= box.left && (ey <= (navBox.top - 5) || ey >= (navBox.top + navBox.height))) || ey <= (box.top - 5) || ex >= (box.left + box.width + 5) || ey >= (box.top + box.height + 5)) {
+                            //     menu.navItem.classList.remove(menu.navView.overItemCls);
+                            //     menu.hide();
+                            // }
                         });
 
                         Ext.Array.each(menuItem, function (mi) {