mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Right-click to clear slots feature
This commit is contained in:
12
app/js/directives/directive-context-menu.js
Normal file
12
app/js/directives/directive-context-menu.js
Normal file
@@ -0,0 +1,12 @@
|
||||
angular.module('app').directive('contextMenu', ['$parse', function($parse) {
|
||||
return function(scope, element, attrs) {
|
||||
var fn = $parse(attrs.contextMenu);
|
||||
console.log(attrs.contextMenu, fn);
|
||||
element.bind('contextmenu', function(e) {
|
||||
scope.$apply(function() {
|
||||
e.preventDefault();
|
||||
fn(scope, { $event:e });
|
||||
});
|
||||
});
|
||||
};
|
||||
}]);
|
||||
Reference in New Issue
Block a user