Allowing event positioning on simple dialogs

This commit is contained in:
Bruno Alves de Faria committed 2017-12-28 08:59:25 -02:00
1 parent 88164d082d
commit 3246bdae7a
2 files changed
+13 -2

No files matched your search

@@ -31,7 +31,16 @@ Template.dialogSimple.onRendered(() => {
// Create the bootstrap modal
$modal.modal(modalOptions);
const position = instance.data.position;
let position = instance.data.position;
const { event } = instance.data;
if (!position && event && !_.isUndefined(event.clientX)) {
position = {
x: event.clientX,
y: event.clientY
};
}
if (position) {
OHIF.ui.repositionDialog($modal, position.x, position.y);
}