public inbox for [email protected]
help / color / mirror / Atom feedFrom: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM3130] User can not open create new object dialogue with alt+shift+n key on collection node
Date: Mon, 4 Nov 2019 13:28:31 +0530
Message-ID: <CAM9w-_kBNG08dMacAexy9xdEgG8dbdCQ2Zn=VUjHt3TDi3BvTA@mail.gmail.com> (raw)
Hi Hackers,
Attached is the patch to fix create object shortcut on collection nodes.
Kindly review.
--
Thanks and Regards,
Aditya Toshniwal
Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Attachments:
[application/octet-stream] RM3130.patch (1.0K, 3-RM3130.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/static/js/keyboard.js b/web/pgadmin/browser/static/js/keyboard.js
index 3958e8cf5..1a402da8d 100644
--- a/web/pgadmin/browser/static/js/keyboard.js
+++ b/web/pgadmin/browser/static/js/keyboard.js
@@ -273,13 +273,20 @@ _.extend(pgBrowser.keyboardNavigation, {
},
bindSubMenuCreate: function() {
const tree = this.getTreeDetails();
-
- if (!tree.d || pgAdmin.Browser.Nodes[tree.t.itemData(tree.i)._type].collection_node === true)
+ let node_obj = pgAdmin.Browser.Nodes[tree.t.itemData(tree.i)._type];
+ if (!tree.d){
return;
+ } else if(node_obj.collection_node === true) {
+ if(node_obj.node) {
+ node_obj = pgAdmin.Browser.Nodes[node_obj.node];
+ } else {
+ return;
+ }
+ }
// Open properties dialog in edit mode
pgAdmin.Browser.Node.callbacks.show_obj_properties.call(
- pgAdmin.Browser.Nodes[tree.t.itemData(tree.i)._type], {action: 'create'}
+ node_obj, {action: 'create', item: tree.i}
);
},
bindSubMenuDelete: function() {
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [pgAdmin][RM3130] User can not open create new object dialogue with alt+shift+n key on collection node
In-Reply-To: <CAM9w-_kBNG08dMacAexy9xdEgG8dbdCQ2Zn=VUjHt3TDi3BvTA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox