diff --git a/app/js/controllers/controller-outfit.js b/app/js/controllers/controller-outfit.js index 41b47479..1bf54b78 100755 --- a/app/js/controllers/controller-outfit.js +++ b/app/js/controllers/controller-outfit.js @@ -83,9 +83,10 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', ' * @param {[type]} slot The slot object belonging to the ship instance * @param {[type]} e The event object */ - $scope.select = function(type, slot, e) { + $scope.select = function(type, slot, e, id) { + console.log('SELECT:', arguments); e.stopPropagation(); - var id = angular.element(e.target).attr('cpid'); // Get component ID + id = id || angular.element(e.target).attr('cpid'); // Get component ID if (id) { if (id == 'empty') { diff --git a/app/js/directives/directive-context-menu.js b/app/js/directives/directive-context-menu.js new file mode 100644 index 00000000..38cc6358 --- /dev/null +++ b/app/js/directives/directive-context-menu.js @@ -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 }); + }); + }); + }; +}]); \ No newline at end of file diff --git a/app/views/page-outfit.html b/app/views/page-outfit.html index 24db3d45..4bbceeb0 100644 --- a/app/views/page-outfit.html +++ b/app/views/page-outfit.html @@ -165,7 +165,7 @@

Internal Compartments

-
+
@@ -175,7 +175,7 @@

HardPoints

-
+
@@ -185,7 +185,7 @@

Utility Mounts

-
+