Templarian / ui.bootstrap.contextMenu

AngularJS Bootstrap UI Context Menu
MIT License
259 stars 127 forks source link

Allow trigger customization - click or contextmenu #43

Closed prasad83 closed 8 years ago

prasad83 commented 8 years ago

Context-menu could be used like dynamic dropdown-menu as well - where click happens on handler. Having trigger controlled from element attribute would make it easy.

<a href="javascript:void(0);" context-menu="menuOptions" context-menu-trigger="click">M</a>
return function ($scope, element, attrs) {
        var trigger = (attrs.contextMenuTrigger || 'contextmenu'); // <-- Customization
        element.on(trigger, function (event) {
StevenRKM commented 8 years ago

I agree, and this is a non-intrusive way of using another event for the contextmenu. I did something similar for my project with only the left mouse button, but I like this better!

janober commented 8 years ago

Also +1 from me. Exactly what I would need right now

josetaira commented 8 years ago

Fixed by https://github.com/Templarian/ui.bootstrap.contextMenu/pull/66