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">
<div id="viewer" class="viewer">
<div id="viewer">
{{ >lesionDialog }}
{{ >hidingPanel }}
<div id="viewportAndLesionTable">

View File

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

View File

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

View File

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

View File

@ -1,4 +1,5 @@
<template name="tabContent">
<div role="tabpanel" class="tab-pane {{active}}" id="{{contentid}}">
{{ >loadingText }}
</div>
</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);
// Remove the loading text template that is inside by default
container.innerHTML = "";
UI.renderWithData(Template.viewer, data, container);
var imageViewer = $("#viewer");
if (imageViewer) {
@ -67,24 +69,20 @@ switchToTab = function(contentId) {
};
openNewTab = function(studyInstanceUid) {
getStudyMetadata(studyInstanceUid, function(study) {
var title = study.seriesList[0].instances[0].patientName;
var contentid = generateUUID();
openNewTab = function(studyInstanceUid, title) {
var contentid = generateUUID();
var data = {
title: title,
contentid: contentid,
};
tabs.insert(data);
var data = {
title: title,
contentid: contentid,
};
tabs.insert(data);
ViewerData[contentid] = {
title: title,
contentid: contentid,
studyInstanceUid: studyInstanceUid
};
switchToTab(contentid);
});
ViewerData[contentid] = {
title: title,
contentid: contentid,
studyInstanceUid: studyInstanceUid
};
switchToTab(contentid);
};
Template.worklist.onRendered(function() {

View File

@ -1,5 +1,5 @@
Template.worklistStudy.events({
'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/tabContent/tabContent.html', 'client');
api.addFiles('components/tabContent/tabContent.styl', 'client');
api.addFiles('components/worklistStudy/worklistStudy.html', 'client');
api.addFiles('components/worklistStudy/worklistStudy.js', 'client');