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

Loading…
Cancel
Save