LT-306: Fixing expanded timepoint on quick switch
This commit is contained in:
parent
60deb9c070
commit
c04c70b325
@ -1,3 +1,7 @@
|
|||||||
|
import { Template } from 'meteor/templating';
|
||||||
|
import { ReactiveVar } from 'meteor/reactive-var';
|
||||||
|
import { Session } from 'meteor/session';
|
||||||
|
|
||||||
Template.studySeriesQuickSwitch.onCreated(() => {
|
Template.studySeriesQuickSwitch.onCreated(() => {
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
|
|
||||||
@ -12,24 +16,35 @@ Template.studySeriesQuickSwitch.onCreated(() => {
|
|||||||
|
|
||||||
// Gets the current viewport data
|
// Gets the current viewport data
|
||||||
const viewportIndex = instance.data.viewportIndex;
|
const viewportIndex = instance.data.viewportIndex;
|
||||||
const viewportData = instance.getViewportData(viewportIndex);
|
|
||||||
|
|
||||||
let study;
|
instance.study = {};
|
||||||
if (viewportData) {
|
instance.lastStudy = {};
|
||||||
// Finds the current study and return it
|
|
||||||
study = ViewerStudies.findOne({
|
|
||||||
studyInstanceUid: viewportData.studyInstanceUid
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
study = ViewerStudies.findOne();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!study) {
|
instance.autorun(() => {
|
||||||
return;
|
Session.get('LayoutManagerUpdated');
|
||||||
}
|
|
||||||
|
|
||||||
// Change the current study to update the thumbnails
|
const viewportData = instance.getViewportData(viewportIndex);
|
||||||
instance.data.currentStudy.set(study);
|
|
||||||
|
if (viewportData) {
|
||||||
|
// Finds the current study and return it
|
||||||
|
instance.study = ViewerStudies.findOne({
|
||||||
|
studyInstanceUid: viewportData.studyInstanceUid
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
instance.study = ViewerStudies.findOne();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!instance.study) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (instance.study.studyInstanceUid !== instance.lastStudy.studyInstanceUid) {
|
||||||
|
// Change the current study to update the thumbnails
|
||||||
|
instance.data.currentStudy.set(instance.study);
|
||||||
|
|
||||||
|
instance.lastStudy = instance.study;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.studySeriesQuickSwitch.events({
|
Template.studySeriesQuickSwitch.events({
|
||||||
@ -61,6 +76,6 @@ Template.studySeriesQuickSwitch.helpers({
|
|||||||
// - http://stackoverflow.com/questions/6165472/custom-css-scrollbar-for-firefox/6165489#6165489
|
// - http://stackoverflow.com/questions/6165472/custom-css-scrollbar-for-firefox/6165489#6165489
|
||||||
// - http://stackoverflow.com/questions/18317634/force-visible-scrollbar-in-firefox-on-mac-os-x/18318273
|
// - http://stackoverflow.com/questions/18317634/force-visible-scrollbar-in-firefox-on-mac-os-x/18318273
|
||||||
addMacOSClass() {
|
addMacOSClass() {
|
||||||
return window.navigator.appVersion.indexOf("Mac") !== -1 ? 'is-mac' : '';
|
return window.navigator.appVersion.indexOf('Mac') !== -1 ? 'is-mac' : '';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
import { Template } from 'meteor/templating';
|
import { Template } from 'meteor/templating';
|
||||||
|
import { ReactiveVar } from 'meteor/reactive-var';
|
||||||
|
import { Tracker } from 'meteor/tracker';
|
||||||
|
import { _ } from 'meteor/underscore';
|
||||||
|
|
||||||
Template.studyTimepointBrowser.onCreated(() => {
|
Template.studyTimepointBrowser.onCreated(() => {
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
@ -26,12 +29,12 @@ Template.studyTimepointBrowser.onCreated(() => {
|
|||||||
studyInstanceUid: studyInstanceUid
|
studyInstanceUid: studyInstanceUid
|
||||||
};
|
};
|
||||||
|
|
||||||
var loadedStudy = ViewerStudies.findOne(query);
|
const loadedStudy = ViewerStudies.findOne(query);
|
||||||
if (loadedStudy) {
|
if (loadedStudy) {
|
||||||
return loadedStudy;
|
return loadedStudy;
|
||||||
}
|
}
|
||||||
|
|
||||||
var notYetLoaded = StudyListStudies.findOne(query);
|
const notYetLoaded = StudyListStudies.findOne(query);
|
||||||
if (!notYetLoaded) {
|
if (!notYetLoaded) {
|
||||||
throw 'No study data available for Study: ' + studyInstanceUid;
|
throw 'No study data available for Study: ' + studyInstanceUid;
|
||||||
}
|
}
|
||||||
@ -50,7 +53,7 @@ Template.studyTimepointBrowser.onRendered(() => {
|
|||||||
|
|
||||||
// Removes all active classes to collapse the timepoints and studies
|
// Removes all active classes to collapse the timepoints and studies
|
||||||
instance.$('.timepointEntry, .studyTimepointStudy').removeClass('active');
|
instance.$('.timepointEntry, .studyTimepointStudy').removeClass('active');
|
||||||
if (type === 'key') {
|
if (type === 'key' && !instance.data.currentStudy) {
|
||||||
// Show only first timepoint expanded for key timepoints
|
// Show only first timepoint expanded for key timepoints
|
||||||
instance.$('.timepointEntry:first').addClass('active');
|
instance.$('.timepointEntry:first').addClass('active');
|
||||||
}
|
}
|
||||||
@ -66,6 +69,12 @@ Template.studyTimepointBrowser.onRendered(() => {
|
|||||||
instance.showAdditionalTimepoints.set(false);
|
instance.showAdditionalTimepoints.set(false);
|
||||||
lastStudy = currentStudy;
|
lastStudy = currentStudy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wait for rerendering and set the timepoint as active
|
||||||
|
Tracker.afterFlush(() => {
|
||||||
|
// Show only first timepoint expanded for key timepoints
|
||||||
|
instance.$('.timepointEntry:first').addClass('active');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<div class="studyModalityBox">
|
<div class="studyModalityBox">
|
||||||
<div class="studyModalityText" style="{{modalityStyle}}">
|
<div class="studyModalityText" style="{{modalityStyle}}">
|
||||||
{{#if this.study.modalities}}
|
{{#if this.study.modalities}}
|
||||||
{{ modalities }}
|
{{modalities}}
|
||||||
{{else}}
|
{{else}}
|
||||||
UN
|
UN
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user