Removing contextMenu templates and title from tabs
This commit is contained in:
1 parent
485f82f64c
commit
0cf4dbf13f
16 files changed
+27
-77
No files matched your search
@@ -7,7 +7,7 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
* @param timepointId The UID of the Timepoint to be opened
|
||||
* @param title The title to be used for the tab heading
|
||||
*/
|
||||
OHIF.lesiontracker.openNewTabWithTimepoint = (timepointId, title) => {
|
||||
OHIF.lesiontracker.openNewTabWithTimepoint = timepointId => {
|
||||
const contentId = 'viewerTab';
|
||||
|
||||
const Timepoints = StudyList.timepointApi.timepoints;
|
||||
@@ -29,7 +29,6 @@ OHIF.lesiontracker.openNewTabWithTimepoint = (timepointId, title) => {
|
||||
|
||||
// Update the ViewerData global object
|
||||
ViewerData[contentId] = {
|
||||
title: title,
|
||||
contentId: contentId,
|
||||
studyInstanceUids: data.studyInstanceUids,
|
||||
timepointIds: data.timepointIds,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { Viewerbase } from 'meteor/ohif:viewerbase';
|
||||
|
||||
Meteor.startup(function() {
|
||||
StudyList.callbacks['dblClickOnStudy'] = dblClickOnStudy;
|
||||
StudyList.callbacks['middleClickOnStudy'] = dblClickOnStudy;
|
||||
StudyList.callbacks.dblClickOnStudy = dblClickOnStudy;
|
||||
StudyList.callbacks.middleClickOnStudy = dblClickOnStudy;
|
||||
|
||||
StudyList.timepointApi = new OHIF.measurements.TimepointApi();
|
||||
StudyList.timepointApi.retrieveTimepoints();
|
||||
@@ -12,28 +12,21 @@ Meteor.startup(function() {
|
||||
/**
|
||||
* Lesion Tracker method including Timepoints / other studies
|
||||
*/
|
||||
function dblClickOnStudy(data) {
|
||||
// Use the formatPN template helper to clean up the patient name
|
||||
let title = Viewerbase.helpers.formatPN(data.patientName);
|
||||
|
||||
const instance = Template.instance();
|
||||
|
||||
const dblClickOnStudy = data => {
|
||||
// Find the relevant timepoint given the clicked-on study
|
||||
const timepointApi = StudyList.timepointApi;
|
||||
if (!timepointApi) {
|
||||
console.log('No timepoint api on dbl-clicked study?');
|
||||
OHIF.log.warn('No timepoint api on dbl-clicked study?');
|
||||
return;
|
||||
}
|
||||
|
||||
const timepoint = timepointApi.study(data.studyInstanceUid)[0];
|
||||
if (timepoint) {
|
||||
// Add the Timepoint name to the Patient name to create the tab title
|
||||
title += ' ' + timepointApi.name(timepoint);
|
||||
OHIF.lesiontracker.openNewTabWithTimepoint(timepoint.timepointId, title);
|
||||
OHIF.lesiontracker.openNewTabWithTimepoint(timepoint.timepointId);
|
||||
} else {
|
||||
open(data.studyInstanceUid, title);
|
||||
openTab(data.studyInstanceUid);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Opens a study
|
||||
@@ -41,14 +34,13 @@ function dblClickOnStudy(data) {
|
||||
* @param studyInstanceUid The UID of the Study to be opened
|
||||
* @param title The title to be used for the tab heading
|
||||
*/
|
||||
function open(studyInstanceUid, title) {
|
||||
const openTab = studyInstanceUid => {
|
||||
const contentId = 'viewerTab';
|
||||
|
||||
ViewerData = window.ViewerData || ViewerData;
|
||||
|
||||
// Update the ViewerData global object
|
||||
ViewerData[contentId] = {
|
||||
title: title,
|
||||
contentId: contentId,
|
||||
isUnassociatedStudy: true,
|
||||
studyInstanceUids: [studyInstanceUid]
|
||||
@@ -56,4 +48,4 @@ function open(studyInstanceUid, title) {
|
||||
|
||||
// Switch to the new tab
|
||||
switchToTab(contentId);
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user