LT-275: Storing the selected label and description on measurements collection
This commit is contained in:
1 parent
20a2a8e453
commit
cd5a1277aa
10 files changed
+157
-84
No files matched your search
@@ -2,25 +2,43 @@ import { Template } from 'meteor/templating';
|
||||
import { Blaze } from 'meteor/blaze';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
const toolMap = {
|
||||
bidirectional: 'targets'
|
||||
};
|
||||
|
||||
OHIF.measurements.toggleLabelButton = options => {
|
||||
const removeButtonView = () => {
|
||||
if (!options.instance.buttonView) {
|
||||
return;
|
||||
}
|
||||
|
||||
Blaze.remove(options.instance.buttonView);
|
||||
options.instance.buttonView = null;
|
||||
};
|
||||
|
||||
if (options.instance.buttonView) {
|
||||
removeButtonView();
|
||||
} else {
|
||||
const data = {
|
||||
position: options.position,
|
||||
threeColumns: true,
|
||||
hideCommon: true,
|
||||
doneCallback(data) {
|
||||
console.warn('>>>>DONE CALLBACK', data);
|
||||
removeButtonView();
|
||||
}
|
||||
};
|
||||
const view = Blaze.renderWithData(Template.measureFlow, data, options.instance.element);
|
||||
options.instance.buttonView = view;
|
||||
}
|
||||
|
||||
const data = {
|
||||
position: options.position,
|
||||
threeColumns: true,
|
||||
hideCommon: true,
|
||||
doneCallback(location, description) {
|
||||
options.callback(options, location, description);
|
||||
|
||||
const tool = toolMap[options.toolData.toolType];
|
||||
|
||||
options.measurementApi[tool].update(options.toolData.id, {
|
||||
$set: {
|
||||
location,
|
||||
description
|
||||
}
|
||||
});
|
||||
|
||||
removeButtonView();
|
||||
}
|
||||
};
|
||||
const view = Blaze.renderWithData(Template.measureFlow, data, options.element);
|
||||
options.instance.buttonView = view;
|
||||
};
|
||||
Reference in new issue
Block a user