Allowing event positioning on simple dialogs
This commit is contained in:
parent
88164d082d
commit
3246bdae7a
@ -31,7 +31,16 @@ Template.dialogSimple.onRendered(() => {
|
|||||||
// Create the bootstrap modal
|
// Create the bootstrap modal
|
||||||
$modal.modal(modalOptions);
|
$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) {
|
if (position) {
|
||||||
OHIF.ui.repositionDialog($modal, position.x, position.y);
|
OHIF.ui.repositionDialog($modal, position.x, position.y);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,9 @@ Template.caseProgress.onCreated(() => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Display the error messages
|
// Display the error messages
|
||||||
const errorHandler = data => OHIF.ui.showDialog('dialogInfo', data);
|
const errorHandler = data => {
|
||||||
|
OHIF.ui.showDialog('dialogInfo', Object.assign({ class: 'themed' }, data));
|
||||||
|
};
|
||||||
|
|
||||||
const promise = instance.data.measurementApi.storeMeasurements();
|
const promise = instance.data.measurementApi.storeMeasurements();
|
||||||
promise.then(successHandler).catch(errorHandler);
|
promise.then(successHandler).catch(errorHandler);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user