Removing contextMenu templates and title from tabs

This commit is contained in:
Bruno Alves de Faria 2017-03-15 07:55:38 -03:00
parent 485f82f64c
commit 0cf4dbf13f
16 changed files with 27 additions and 77 deletions

View File

@ -92,7 +92,7 @@ Template.viewer.onCreated(() => {
OHIF.log.info('Setting default ViewerData');
OHIF.viewer.loadedSeriesData = {};
ViewerData[contentId].loadedSeriesData = {};
Session.set('ViewerData', ViewerData);
Session.setPersistent('ViewerData', ViewerData);
}
Session.set('activeViewport', ViewerData[contentId].activeViewport || false);

View File

@ -15,9 +15,7 @@ Router.configure({
Router.onBeforeAction('loading');
const data = {
additionalTemplates: []
};
const data = {};
const routerOptions = { data };
@ -29,7 +27,7 @@ Router.route('/', function() {
} else {
const contentId = Session.get('activeContentId');
if (!contentId) {
Session.set('activeContentId', 'studylistTab');
Session.setPersistent('activeContentId', 'studylistTab');
}
this.render('app', routerOptions);

View File

@ -3,6 +3,7 @@
<title>OHIF Viewer</title>
<meta name="description" content="Open Health Imaging Foundation DICOM Viewer">
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no">
<link rel="shortcut icon" type="image/png" href="/images/logo.png" sizes="16x16 32x32 64x64">
<!--Best display for mobile devices-->
<meta http-equiv="cleartype" content="on">
<meta name="MobileOptimized" content="320">

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -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,

View File

@ -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);
}
};

View File

@ -43,7 +43,6 @@ const viewStudies = () => {
return;
}
const title = selectedStudies[0].patientName;
const studyInstanceUids = selectedStudies.map(study => study.studyInstanceUid);
const contentId = 'viewerTab';
@ -51,7 +50,6 @@ const viewStudies = () => {
// Update the ViewerData global object
ViewerData[contentId] = {
title: title,
contentId: contentId,
studyInstanceUids: studyInstanceUids
};

View File

@ -1,2 +0,0 @@
import './studyContextMenu.html';
import './studyContextMenu.js';

View File

@ -1,12 +0,0 @@
<template name="studyContextMenu">
{{#dropdownForm}}
<li><a id="viewSeriesDetails" type="button"
title="View Series Details"
>View Series Details</a></li>
<li class="disabled"><a class="disabled">Anonymize</a></li>
<li class="disabled"><a class="disabled">Send</a></li>
<li class="divider" role="separator"></li>
<li class="disabled"><a class="disabled">Delete</a></li>
<li><a id="exportSelectedStudies" title="Export Selected Studies">Export</a></li>
{{/dropdownForm}}
</template>

View File

@ -1,23 +0,0 @@
import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core';
Meteor.startup(() => {
OHIF.studylist.dropdown.setItems([{
action: OHIF.studylist.viewSeriesDetails,
text: 'View Series Details'
}, {
text: 'Anonymize',
disabled: true
}, {
text: 'Send',
disabled: true,
separatorAfter: true
}, {
text: 'Delete',
disabled: true
}, {
action: OHIF.studylist.exportSelectedStudies,
text: 'Export',
title: 'Export Selected Studies'
}]);
});

View File

@ -10,7 +10,4 @@
</div>
</div>
</div>
{{#each templateName in additionalTemplates}}
{{>Template.dynamic template=templateName}}
{{/each}}
</template>

View File

@ -31,7 +31,7 @@ Template.studylist.onRendered(() => {
const instance = Template.instance();
if (instance.data && instance.data.studyInstanceUid) {
const studyInstanceUid = instance.data.studyInstanceUid;
openNewTab(studyInstanceUid, studyInstanceUid);
openNewTab(studyInstanceUid);
} else {
// If there is a tab set as active in the Session,
// switch to that now.

View File

@ -1,22 +1,23 @@
import { Random } from 'meteor/random';
import { OHIF } from 'meteor/ohif:core';
/**
* Opens a new tab in the tabbed studylist environment using
* a given study and new tab title.
*
* @param studyInstanceUid The UID of the Study to be opened
* @param title The title to be used for the tab heading
*/
openNewTab = function(studyInstanceUid, title) {
console.log('openNewTab');
const openNewTab = studyInstanceUid => {
OHIF.log.info('openNewTab');
// Generate a unique ID to represent this tab
// We can't just use the Mongo entry ID because
// then it will change after hot-reloading.
var contentId = Random.id();
const contentId = Random.id();
// Update the ViewerData global object
ViewerData = window.ViewerData || ViewerData;
ViewerData[contentId] = {
title: title,
contentId: contentId,
studyInstanceUids: [studyInstanceUid]
};

View File

@ -22,9 +22,7 @@ StudyList.callbacks.dblClickOnStudy = dblClickOnStudy;
StudyList.callbacks.middleClickOnStudy = dblClickOnStudy;
function dblClickOnStudy(data) {
// Use the formatPN template helper to clean up the patient name
var title = Viewerbase.helpers.formatPN(data.patientName);
openNewTab(data.studyInstanceUid, title);
openNewTab(data.studyInstanceUid);
}
let currentServerChangeHandlerFirstRun = true;

View File

@ -2,6 +2,8 @@ import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core';
OHIF.user.getName = () => {
const user = Meteor.user();
if (!user) return '';
const nameSplit = Meteor.user().profile.fullName.split(' ');
const lastName = nameSplit[nameSplit.length - 1];
nameSplit[nameSplit.length - 1] = lastName.substr(0, 1) + '.';

View File

@ -14,6 +14,7 @@ Package.onUse(function(api) {
api.use('stylus');
api.use('momentjs:moment');
api.use('validatejs');
api.use('u2622:persistent-session');
// Our custom packages
api.use('ohif:design');