Cheers for that. I am happy that it is working, and no worries about using leptonx.createContextMenuWithin
.
I more was talking about where I ended up having to call it from, the event handler issues, and the change I made to pass document.querySelector('#lpx-toolbar')
instead of using the 'notification-bar' id - was just checking whether I had gone the right way with these.
Anyway it is working so I will close. Thanks again for that.
Sorry I didn't reply earlier - took me a while to get back to it and also took me a while to get it working. I did get it working, but had to make a few changes:
leptonx.createContextMenuWithin(document.querySelector('#lpx-toolbar'), 'notification-bar');
This all became a little messier than the suggested solution, so if you have a better way to achieve this, or an answer to why it didn't work using your first solution, please let me know.
Thanks!