Pass event target to context menu

pull/1742/head
Hagen Schink 10 years ago
parent 114a9aaa04
commit e062cca450
  1. 10
      app/assets/javascripts/angular/ui_components/has-dropdown-menu-directive.js

@ -64,18 +64,18 @@ angular.module('openproject.uiComponents')
locals[key] = scope[key]; locals[key] = scope[key];
}); });
function toggle() { function toggle(event) {
active() ? close() : open(); active() ? close() : open(event);
} }
function active() { function active() {
return contextMenu.active() && ctrl.opened(); return contextMenu.active() && ctrl.opened();
} }
function open() { function open(event) {
ctrl.open(); ctrl.open();
contextMenu.open(locals) contextMenu.open(event.target, locals)
.then(function(element) { .then(function(element) {
menuElement = element; menuElement = element;
}); });
@ -96,7 +96,7 @@ angular.module('openproject.uiComponents')
event.stopPropagation(); event.stopPropagation();
scope.$apply(function() { scope.$apply(function() {
toggle(); toggle(event);
}); });
// set css position parameters after the digest has been completed // set css position parameters after the digest has been completed

Loading…
Cancel
Save