|
|
@@ -43,9 +43,22 @@ Ext.define('saas.view.main.Navigation', {
|
|
|
singleSelect: true,
|
|
|
itemSelector: '.x-navitem',
|
|
|
listeners: {
|
|
|
- itemmouseenter: me.showNavMenu,
|
|
|
- itemmouseleave: me.hideNavMenu,
|
|
|
- itemClick: me.clickNavMenu,
|
|
|
+ itemmouseenter: function(navView, record, navItem, index, e, eOpts) {
|
|
|
+ window.clearTimeout(me.Timer);
|
|
|
+ me.Timer = setTimeout(function() {
|
|
|
+ me.showNavMenu(navView, record, navItem, index, e, eOpts);
|
|
|
+ }, 80);
|
|
|
+ },
|
|
|
+ itemmouseleave: function(view, record, item, index, e, eOpts) {
|
|
|
+ window.clearTimeout(me.Timer);
|
|
|
+ me.hideNavMenu(view, record, item, index, e, eOpts);
|
|
|
+ },
|
|
|
+ itemClick: function(navView, record, navItem, index, e, eOpts) {
|
|
|
+ window.clearTimeout(me.Timer);
|
|
|
+ me.Timer = setTimeout(function() {
|
|
|
+ me.showNavMenu(navView, record, navItem, index, e, eOpts);
|
|
|
+ }, 20);
|
|
|
+ },
|
|
|
scope: me
|
|
|
}
|
|
|
});
|
|
|
@@ -58,10 +71,10 @@ Ext.define('saas.view.main.Navigation', {
|
|
|
me.callParent();
|
|
|
},
|
|
|
|
|
|
- clickNavMenu: function (view, record, item, index, e, eOpts) {
|
|
|
- var me = this;
|
|
|
- this.showNavMenu(view, record, item, index, e, eOpts);
|
|
|
- },
|
|
|
+ // clickNavMenu: function (view, record, item, index, e, eOpts) {
|
|
|
+ // var me = this;
|
|
|
+ // this.showNavMenu(view, record, item, index, e, eOpts);
|
|
|
+ // },
|
|
|
|
|
|
showNavMenu: function (navView, record, navItem, index, e, eOpts) {
|
|
|
var me = this,
|
|
|
@@ -200,15 +213,17 @@ Ext.define('saas.view.main.Navigation', {
|
|
|
|
|
|
hideNavMenu: function (view, record, item, index, e, eOpts) {
|
|
|
var recData = record.data,
|
|
|
- cx = e.browserEvent.clientX,
|
|
|
- cy = e.browserEvent.clientY,
|
|
|
- itemBox = item.getBoundingClientRect(),
|
|
|
id = recData.id,
|
|
|
menuId = 'navMenu-' + id,
|
|
|
- menu = Ext.getCmp(menuId);
|
|
|
+ menu = Ext.getCmp(menuId),
|
|
|
+ cx, cy, itemBox;
|
|
|
+
|
|
|
+ if (menu) {
|
|
|
+ cx = e.browserEvent.clientX,
|
|
|
+ cy = e.browserEvent.clientY,
|
|
|
+ itemBox = item.getBoundingClientRect();
|
|
|
|
|
|
- if (cx <= itemBox.left || cy <= itemBox.top || (cy >= (itemBox.top + itemBox.height) && cx <= (itemBox.left + itemBox.width - 10))) {
|
|
|
- if (menu) {
|
|
|
+ if (cx <= itemBox.left || cy <= itemBox.top || (cy >= (itemBox.top + itemBox.height) && cx <= (itemBox.left + itemBox.width - 10))) {
|
|
|
menu.hide();
|
|
|
}
|
|
|
}
|