LT-251: Making studies clickable to trigger series state
This commit is contained in:
1 parent
b6e95b567b
commit
0d9afa3557
6 files changed
+46
-34
No files matched your search
@@ -2,7 +2,7 @@
|
||||
<div class="studyTimepointWrapper">
|
||||
<div class="studyTimepoint">
|
||||
{{#each study in studies}}
|
||||
{{>studyTimepointStudy study=study active=(isActive study) viewportIndex=viewportIndex}}
|
||||
{{>studyTimepointStudy study=study active=(isActive study) viewportIndex=this.viewportIndex}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,8 +30,17 @@ Template.studyTimepoint.events({
|
||||
'selectionChanged .studyTimepoint'(event, instance, changed) {
|
||||
const $selection = $(changed.selection);
|
||||
|
||||
// Defines where will be the studies searched
|
||||
let $studiesTarget = instance.$('.studyTimepoint');
|
||||
|
||||
if (changed.isQuickSwitch) {
|
||||
// Changes the current quick switch study
|
||||
const study = ViewerStudies.findOne({
|
||||
studyInstanceUid: changed.studyInstanceUid
|
||||
});
|
||||
instance.data.currentStudy.set(study);
|
||||
|
||||
// Changes the target to toggle the selection in all the studies
|
||||
$studiesTarget = $studiesTarget.closest('.studyTimepointBrowser');
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div class="timepointModalities">{{modalitiesSummary timepoint}}</div>
|
||||
</div>
|
||||
{{>studyTimepoint studies=(studies timepoint) index=@index viewportIndex=viewportIndex}}
|
||||
{{>studyTimepoint studies=(studies timepoint) index=@index viewportIndex=this.viewportIndex currentStudy=this.currentStudy}}
|
||||
</div>
|
||||
<hr class="m-y-1">
|
||||
{{/if}}
|
||||
|
||||
+5
-3
@@ -48,12 +48,14 @@ Template.studyTimepointStudy.events({
|
||||
},
|
||||
|
||||
// Changes the current study selection for the clicked study
|
||||
'click .studySidebarTimepoint .studyModality'(event, instance) {
|
||||
'click .studyModality'(event, instance) {
|
||||
const $study = $(event.currentTarget).closest('.studyTimepointStudy');
|
||||
|
||||
const studyData = instance.data.study;
|
||||
const studyInstanceUid = studyData.studyInstanceUid;
|
||||
|
||||
const isQuickSwitch = !_.isUndefined(instance.data.viewportIndex);
|
||||
|
||||
// Check if the study already has series data,
|
||||
// and if not, retrieve it.
|
||||
if (!studyData.seriesList) {
|
||||
@@ -65,13 +67,13 @@ Template.studyTimepointStudy.events({
|
||||
$study.addClass('loading');
|
||||
getStudyMetadata(studyInstanceUid, studyData => {
|
||||
ViewerStudies.insert(studyData);
|
||||
instance.select();
|
||||
instance.select(isQuickSwitch);
|
||||
});
|
||||
} else {
|
||||
studyData.seriesList = alreadyLoaded.seriesList;
|
||||
}
|
||||
} else {
|
||||
instance.select();
|
||||
instance.select(isQuickSwitch);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user