Made tabs open before study loads. Added study loading indicator

This commit is contained in:
Erik Ziegler 2015-11-06 12:36:38 +01:00
parent 814e6f7741
commit b5f94412fa
10 changed files with 34 additions and 21 deletions

View File

@ -1,5 +1,5 @@
<template name="viewer"> <template name="viewer">
<div id="viewer" class="viewer"> <div id="viewer">
{{ >lesionDialog }} {{ >lesionDialog }}
{{ >hidingPanel }} {{ >hidingPanel }}
<div id="viewportAndLesionTable"> <div id="viewportAndLesionTable">

View File

@ -1,4 +1,4 @@
.viewer #viewer
width: 100% width: 100%
height: 100% height: 100%
margin: 0 margin: 0

View File

@ -5,6 +5,11 @@ function defaultHangingProtocol(inputData) {
var viewportRows = inputData.viewportRows; var viewportRows = inputData.viewportRows;
var viewportColumns = inputData.viewportColumns; var viewportColumns = inputData.viewportColumns;
if (!studies.length) {
log.warn("No studies provided to Hanging Protocol");
return;
}
// This is the most basic hanging protocol. // This is the most basic hanging protocol.
var stacks = []; var stacks = [];
studies.forEach(function(study) { studies.forEach(function(study) {

View File

@ -1,4 +1,5 @@
.loadingTextDiv .loadingTextDiv
margin: 30px margin: 30px
h5 h5
text-align: center text-align: center

View File

@ -1,4 +1,5 @@
<template name="tabContent"> <template name="tabContent">
<div role="tabpanel" class="tab-pane {{active}}" id="{{contentid}}"> <div role="tabpanel" class="tab-pane {{active}}" id="{{contentid}}">
{{ >loadingText }}
</div> </div>
</template> </template>

View File

@ -0,0 +1,4 @@
.tab-pane
.loadingTextDiv
h5
color: #777

View File

@ -1 +1,4 @@
.tabTitle
button.close
// Prevent blue glow around button in Chrome
outline: none

View File

@ -54,6 +54,8 @@ switchToTab = function(contentId) {
Session.set('studies', data.studies); Session.set('studies', data.studies);
// Remove the loading text template that is inside by default
container.innerHTML = "";
UI.renderWithData(Template.viewer, data, container); UI.renderWithData(Template.viewer, data, container);
var imageViewer = $("#viewer"); var imageViewer = $("#viewer");
if (imageViewer) { if (imageViewer) {
@ -67,24 +69,20 @@ switchToTab = function(contentId) {
}; };
openNewTab = function(studyInstanceUid) { openNewTab = function(studyInstanceUid, title) {
getStudyMetadata(studyInstanceUid, function(study) { var contentid = generateUUID();
var title = study.seriesList[0].instances[0].patientName; var data = {
var contentid = generateUUID(); title: title,
contentid: contentid,
};
tabs.insert(data);
var data = { ViewerData[contentid] = {
title: title, title: title,
contentid: contentid, contentid: contentid,
}; studyInstanceUid: studyInstanceUid
tabs.insert(data); };
switchToTab(contentid);
ViewerData[contentid] = {
title: title,
contentid: contentid,
studyInstanceUid: studyInstanceUid
};
switchToTab(contentid);
});
}; };
Template.worklist.onRendered(function() { Template.worklist.onRendered(function() {

View File

@ -1,5 +1,5 @@
Template.worklistStudy.events({ Template.worklistStudy.events({
'click': function () { 'click': function () {
openNewTab(this.studyInstanceUid); openNewTab(this.studyInstanceUid, this.patientName);
} }
}); });

View File

@ -29,6 +29,7 @@ Package.onUse(function (api) {
api.addFiles('components/tabTitle/tabTitle.styl', 'client'); api.addFiles('components/tabTitle/tabTitle.styl', 'client');
api.addFiles('components/tabContent/tabContent.html', 'client'); api.addFiles('components/tabContent/tabContent.html', 'client');
api.addFiles('components/tabContent/tabContent.styl', 'client');
api.addFiles('components/worklistStudy/worklistStudy.html', 'client'); api.addFiles('components/worklistStudy/worklistStudy.html', 'client');
api.addFiles('components/worklistStudy/worklistStudy.js', 'client'); api.addFiles('components/worklistStudy/worklistStudy.js', 'client');