mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
13 lines
329 B
JavaScript
13 lines
329 B
JavaScript
angular.module('app').directive('contextMenu', ['$parse', function($parse) {
|
|
return function(scope, element, attrs) {
|
|
var fn = $parse(attrs.contextMenu);
|
|
|
|
element.bind('contextmenu', function(e) {
|
|
scope.$apply(function() {
|
|
e.preventDefault();
|
|
fn(scope, { $event: e });
|
|
});
|
|
});
|
|
};
|
|
}]);
|