OHIF-110: creating the context-menu for measurements in the viewport for desktop and mobile. Coded action delete (#112)

This commit is contained in:
André Botelho Almeida authored and Erik Ziegler committed 2017-09-27 21:55:14 +02:00
1 parent af4b8b45f5
commit bacfa24216
4 files changed
+129 -2

No files matched your search

@@ -105,11 +105,20 @@ OHIF.mixins.dropdown = new OHIF.Mixin({
// Change the dropdown position if mouse event was given
if (event) {
const originalEventTouches = event.originalEvent.touches;
const position = {
left: event.clientX,
top: event.clientY
left: 0,
top: 0
};
if (originalEventTouches && originalEventTouches.length > 0) {
position.left = originalEventTouches[0].pageX;
position.top = originalEventTouches[0].pageY;
} else {
position.left = event.clientX;
position.top = event.clientY
}
if (centered) {
// Center the dropdown menu based on the event mouse position
position.left -= $dropdownMenu.outerWidth() / 2;