Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Set the Correct Location for a Context Menu (Read 471 times)
alukes
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Jul 1st, 2011
Set the Correct Location for a Context Menu
Jun 25th, 2023 at 2:38am
Print Post  
I want a context menu to appear where I will create a node. I can get the node to be created where it should.

The context menu is always too close to the upper left corner. I am guessing I need to convert rectangle values to pixel values. How do I do that?

Is there a native way to generate a context menu within Mindfusion?

function onClicked(sender, args) {
  var x = args.mousePosition.x;
  var y = args.mousePosition.y;
 
  contextMenu.style.left = x + 'px';
  contextMenu.style.top = y + 'px';
  contextMenu.style.zIndex = 50;
}

Thanks
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Set the Correct Location for a Context Menu
Reply #1 - Jun 26th, 2023 at 9:53am
Print Post  
Hi,

Try the code from this post -
https://mindfusion.eu/Forum/YaBB.pl?num=1683773362/2#2

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
alukes
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Jul 1st, 2011
Re: Set the Correct Location for a Context Menu
Reply #2 - Jun 28th, 2023 at 11:48am
Print Post  
That took care of the problem.

Thanks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint