LT-354: Repositioning confirmation dialog considering the cursor position
This commit is contained in:
parent
6e2bef5317
commit
c3999083a8
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
{{#let classes=getRemoveAssociationClasses}}
|
{{#let classes=getRemoveAssociationClasses}}
|
||||||
<li class="{{classes}}">
|
<li class="{{classes}}">
|
||||||
<a id="removeTimepointAssociations" type="button" class="{{classes}}"
|
<a id="removeTimepointAssociations" type="button" class="{{classes}}"
|
||||||
title="Remove Timepoint Association">Remove Association</a>
|
title="Remove Timepoint Association">Remove Association</a>
|
||||||
</li>
|
</li>
|
||||||
{{/let}}
|
{{/let}}
|
||||||
|
|||||||
@ -72,11 +72,15 @@ StudyList.functions.viewStudies = viewStudies;
|
|||||||
/**
|
/**
|
||||||
* Removes all present study / timepoint associations from the Clinical Trial
|
* Removes all present study / timepoint associations from the Clinical Trial
|
||||||
*/
|
*/
|
||||||
function removeTimepointAssociations() {
|
function removeTimepointAssociations($study, event) {
|
||||||
const dialogSettings = {
|
const dialogSettings = {
|
||||||
title: 'Remove Association',
|
title: 'Remove Association',
|
||||||
message: 'Measurements related to this Study and Timepoint will be erased. Do you really want to delete this association?',
|
message: 'Measurements related to this Study and Timepoint will be erased. Do you really want to delete this association?',
|
||||||
confirmClass: 'btn-danger'
|
confirmClass: 'btn-danger',
|
||||||
|
position: {
|
||||||
|
x: event.clientX,
|
||||||
|
y: event.clientY
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
OHIF.ui.showFormDialog('dialogConfirm', dialogSettings).then(() => {
|
OHIF.ui.showFormDialog('dialogConfirm', dialogSettings).then(() => {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { Template } from 'meteor/templating';
|
||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
import { $ } from 'meteor/jquery';
|
import { $ } from 'meteor/jquery';
|
||||||
|
|
||||||
@ -55,21 +56,19 @@ function viewSeriesDetails() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Template.studyContextMenu.events({
|
Template.studyContextMenu.events({
|
||||||
'click a': function(e) {
|
'click a'(event, instance) {
|
||||||
var id, fn, target = $(e.currentTarget);
|
const $target = $(event.currentTarget);
|
||||||
|
|
||||||
if (target.hasClass('disabled')) {
|
if ($target.hasClass('disabled')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
id = target.attr('id');
|
const id = $target.attr('id');
|
||||||
if (id in StudyList.functions) {
|
if (id in StudyList.functions) {
|
||||||
fn = StudyList.functions[id];
|
const fn = StudyList.functions[id];
|
||||||
if (typeof fn === 'function') {
|
if (typeof fn === 'function') {
|
||||||
fn(Template.studyContextMenu.$study);
|
fn(Template.studyContextMenu.$study, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var dialog = $('#studyContextMenu');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user