From e062cca4507ab5c7c017086da5aa0610adf8934d Mon Sep 17 00:00:00 2001 From: Hagen Schink Date: Mon, 11 Aug 2014 13:59:31 +0200 Subject: [PATCH] Pass event target to context menu --- .../ui_components/has-dropdown-menu-directive.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/angular/ui_components/has-dropdown-menu-directive.js b/app/assets/javascripts/angular/ui_components/has-dropdown-menu-directive.js index 39e3d149d4..f4291e2907 100644 --- a/app/assets/javascripts/angular/ui_components/has-dropdown-menu-directive.js +++ b/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