rightclick.js 374 B

1234567891011
  1. app.directive('ngRightClick', function($parse) {
  2. return function(scope, element, attrs) {
  3. var fn = $parse(attrs.ngRightClick);
  4. element.bind('contextmenu', function(event) {
  5. scope.$apply(function() {
  6. event.preventDefault();
  7. fn(scope, {$event:event});
  8. });
  9. });
  10. };
  11. });