public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin][RM3523] Right clicking a browser object does not apply to the object on which right click was fired.
2+ messages / 2 participants
[nested] [flat]
* [pgAdmin][RM3523] Right clicking a browser object does not apply to the object on which right click was fired.
@ 2020-04-10 09:59 Aditya Toshniwal <[email protected]>
2020-04-10 12:07 ` Re: [pgAdmin][RM3523] Right clicking a browser object does not apply to the object on which right click was fired. Akshay Joshi <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Aditya Toshniwal @ 2020-04-10 09:59 UTC (permalink / raw)
To: pgadmin-hackers
Hi Hackers,
Attached is the patch to fix a context menu issue where Ctrl+Click a
browser object opens the context menu, but the menu operations does not
apply on the item selected.
The patch also fixes keyboard navigation on the context menu applied to
browser tree.
Please review.
--
Thanks and Regards,
Aditya Toshniwal
pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Attachments:
[application/octet-stream] RM3523.patch (1.1K, 3-RM3523.patch)
download | inline diff:
diff --git a/web/pgadmin/static/js/tree/tree.js b/web/pgadmin/static/js/tree/tree.js
index 984d247d3..aa0a57057 100644
--- a/web/pgadmin/static/js/tree/tree.js
+++ b/web/pgadmin/static/js/tree/tree.js
@@ -371,6 +371,27 @@ export class Tree {
}
}.bind(this));
this.aciTreeApi = $treeJQuery.aciTree('api');
+
+ /* Ctrl + Click will trigger context menu. Select the node when Ctrl+Clicked.
+ * When the context menu is visible, the tree should lose focus
+ * to use context menu with keyboard. Otherwise, the tree functions
+ * overrides the keyboard events.
+ */
+ let contextHandler = (ev)=>{
+ let treeItem = this.aciTreeApi.itemFrom(ev.target);
+ if(treeItem.length) {
+ if(ev.ctrlKey) {
+ this.aciTreeApi.select(treeItem);
+ }
+ $(treeItem).on('contextmenu:visible', ()=>{
+ $(treeItem).trigger('blur');
+ $(treeItem).off('contextmenu:visible');
+ });
+ }
+ };
+ $treeJQuery
+ .off('mousedown', contextHandler)
+ .on('mousedown', contextHandler);
}
/**
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgAdmin][RM3523] Right clicking a browser object does not apply to the object on which right click was fired.
2020-04-10 09:59 [pgAdmin][RM3523] Right clicking a browser object does not apply to the object on which right click was fired. Aditya Toshniwal <[email protected]>
@ 2020-04-10 12:07 ` Akshay Joshi <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Akshay Joshi @ 2020-04-10 12:07 UTC (permalink / raw)
To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers
Thanks, patch applied.
On Fri, Apr 10, 2020 at 3:30 PM Aditya Toshniwal <
[email protected]> wrote:
> Hi Hackers,
>
> Attached is the patch to fix a context menu issue where Ctrl+Click a
> browser object opens the context menu, but the menu operations does not
> apply on the item selected.
> The patch also fixes keyboard navigation on the context menu applied to
> browser tree.
>
> Please review.
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
> "Don't Complain about Heat, Plant a TREE"
>
--
*Thanks & Regards*
*Akshay Joshi*
*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-04-10 12:07 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-10 09:59 [pgAdmin][RM3523] Right clicking a browser object does not apply to the object on which right click was fired. Aditya Toshniwal <[email protected]>
2020-04-10 12:07 ` Akshay Joshi <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox