Skip to content

Commit

Permalink
Ensure browser toolbar are enabled only on database object selection.p…
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshmahajan-1903 committed Jan 13, 2025
1 parent de6fbe7 commit 8581c75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export class FileTreeItem extends React.Component<IItemRendererXProps & IItemRen
data-depth={item.depth}
onContextMenu={this.handleContextMenu}
onClick={this.handleClick}
onDoubleClick={this.handleDoubleClick}
onDragStart={this.handleDragStartItem}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
Expand All @@ -107,7 +106,7 @@ export class FileTreeItem extends React.Component<IItemRendererXProps & IItemRen
: null
}

<span className='file-label'>
<span className='file-label' onDoubleClick={this.handleDoubleClick}>
{
item._metadata?.data?.icon ?
<i className={cn('file-icon', item._metadata?.data?.icon ? item._metadata.data.icon : fileOrDir)} /> : null
Expand Down
3 changes: 3 additions & 0 deletions web/pgadmin/tools/sqleditor/static/js/SQLEditorModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ export default class SQLEditor {
let isEnabled = (() => {
if (!_.isUndefined(obj) && !_.isNull(obj)) {
if (_.indexOf(pgAdmin.unsupported_nodes, obj._type) == -1) {
let t = pgBrowser.tree,
selected_item = t.selected(),
selected_item_type = t.findNodeByDomElement(selected_item).getData()._type;
if (obj._type == 'database' && obj.allowConn) {
return true;
} else if (obj._type != 'database') {
Expand Down

0 comments on commit 8581c75

Please sign in to comment.