Desktop markdown wiki app. Built with node, Electron Framework and AngularJS.

right-click-directive.js 377B

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