mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-09 23:15:58 -06:00
Fix an issue where all the menus are enabled when pgAdmin is opened and no object is selected in the object explorer. #6435
This commit is contained in:
parent
5a701b7c61
commit
f7bc826262
@ -43,4 +43,5 @@ Bug fixes
|
||||
| `Issue #6363 <https://github.com/pgadmin-org/pgadmin4/issues/6363>`_ - Fixed an issue where preview images for themes were not loading.
|
||||
| `Issue #6420 <https://github.com/pgadmin-org/pgadmin4/issues/6420>`_ - Fix raise notice from func/proc or code blocks are no longer displayed live.
|
||||
| `Issue #6431 <https://github.com/pgadmin-org/pgadmin4/issues/6431>`_ - Fix an issue where PSQL is not working if the database name have quotes or double quotes.
|
||||
| `Issue #6431 <https://github.com/pgadmin-org/pgadmin4/issues/6435>`_ - Fix an issue where all the menus are enabled when pgAdmin is opened and no object is selected in the object explorer.
|
||||
|
||||
|
@ -176,7 +176,7 @@ export class MenuItem {
|
||||
* Checks this menu enable/disable state based on the selection.
|
||||
*/
|
||||
disabled(node, item) {
|
||||
if (this.enable == undefined || !node) {
|
||||
if (this.enable == undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -192,12 +192,15 @@ export class MenuItem {
|
||||
}
|
||||
|
||||
if (_.isBoolean(this.enable)) return !this.enable;
|
||||
if (_.isFunction(this.enable)) {
|
||||
if (_.isFunction(this.enable) && node) {
|
||||
return !this.enable.apply(this.module, [node, item, this.data]);
|
||||
}
|
||||
if (this.module && _.isBoolean(this.module[this.enable])) {
|
||||
return !this.module[this.enable];
|
||||
}
|
||||
if(!node) {
|
||||
return true;
|
||||
}
|
||||
if (this.module && _.isFunction(this.module[this.enable])) {
|
||||
return !(this.module[this.enable]).apply(this.module, [node, item, this.data]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user