jakiestfu / Context.js

Contextual Menus with Twitters Bootstrap.css
http://lab.jakiestfu.com/contextjs/
248 stars 62 forks source link

Context menu on top #26

Open Ganbin opened 9 years ago

Ganbin commented 9 years ago

Hello,

Great library thanks for the sharing.

I have a problem in my app. The context menu always appear on top of my mouse like if I am on the bottom of the page. I wonder if it is because of my html. I use it in the context of a Wakanda application inside of a grid widget.

Do you have any advise to force the context menu to open on bottom of my mouse?

Ganbin commented 9 years ago

Finally I look up in the code and find out that you have define some code for the above : true and above : 'auto', but not for the above : false. So I have add this code to the addContext method.

I have add a pull request : Add the ability to have the above option to false. #27

else if (typeof options.above == 'boolean' && !options.above){ $dd.css({ top: e.pageY + 10, left: e.pageX - 13 }).fadeIn(options.fadeSpeed); }

fabiocaccamo commented 8 years ago

+1 The same problem occurs if we are on the right of the page (the first context menu appears on the right of the mouse)

Thanks for this great lib.