|
|
@@ -101,8 +101,6 @@ class Menu {
|
|
|
*/
|
|
|
open() {
|
|
|
this.runLocalHooks('beforeOpen');
|
|
|
- // 2021-02-24 zhang createContainer里面先查找是否存在,有则返回。 如果不这样做的话,element-tabs 设置成lazzy后,后加载的页面会冲掉之前页面的右键菜单
|
|
|
- this.container = this.createContainer(this.options.name);
|
|
|
this.container.removeAttribute('style');
|
|
|
this.container.style.display = 'block';
|
|
|
|
|
|
@@ -286,8 +284,8 @@ class Menu {
|
|
|
|
|
|
// Don't close context menu if item is disabled or it has submenu
|
|
|
if (selectedItem.disabled === true ||
|
|
|
- (typeof selectedItem.disabled === 'function' && selectedItem.disabled.call(this.hot) === true) ||
|
|
|
- selectedItem.submenu) {
|
|
|
+ (typeof selectedItem.disabled === 'function' && selectedItem.disabled.call(this.hot) === true) ||
|
|
|
+ selectedItem.submenu) {
|
|
|
autoClose = false;
|
|
|
}
|
|
|
|
|
|
@@ -564,7 +562,8 @@ class Menu {
|
|
|
* @private
|
|
|
*/
|
|
|
blockMainTableCallbacks() {
|
|
|
- this._afterScrollCallback = function() {};
|
|
|
+ this._afterScrollCallback = function() {
|
|
|
+ };
|
|
|
this.hot.addHook('afterScrollVertically', this._afterScrollCallback);
|
|
|
this.hot.addHook('afterScrollHorizontally', this._afterScrollCallback);
|
|
|
}
|
|
|
@@ -710,9 +709,9 @@ class Menu {
|
|
|
if (this.options.standalone && this.hotMenu && !isChildOf(event.target, this.hotMenu.rootElement)) {
|
|
|
this.close(true);
|
|
|
|
|
|
- // Automatically close menu when clicked element is not belongs to menu or submenu (not necessarily to itself)
|
|
|
+ // Automatically close menu when clicked element is not belongs to menu or submenu (not necessarily to itself)
|
|
|
} else if ((this.isAllSubMenusClosed() || this.isSubMenu()) &&
|
|
|
- (!isChildOf(event.target, '.htMenu') && isChildOf(event.target, document))) {
|
|
|
+ (!isChildOf(event.target, '.htMenu') && isChildOf(event.target, document))) {
|
|
|
this.close(true);
|
|
|
}
|
|
|
}
|