OHIF-179: Only show left side bar when study has more than one series (#131)
This commit is contained in:
parent
004ccbc378
commit
e6b18f6c96
@ -4,10 +4,26 @@ import { $ } from 'meteor/jquery';
|
|||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
import 'meteor/ohif:viewerbase';
|
import 'meteor/ohif:viewerbase';
|
||||||
|
|
||||||
|
function isThereSeries(studies) {
|
||||||
|
if (studies.length === 1) {
|
||||||
|
const study = studies[0];
|
||||||
|
|
||||||
|
if (study.seriesList && study.seriesList.length > 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (study.displaySets && study.displaySets.length > 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Template.toolbarSection.onCreated(() => {
|
Template.toolbarSection.onCreated(() => {
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
|
|
||||||
if (OHIF.uiSettings.leftSidebarOpen) {
|
if (OHIF.uiSettings.leftSidebarOpen && isThereSeries(instance.data.studies)) {
|
||||||
instance.data.state.set('leftSidebar', 'studies');
|
instance.data.state.set('leftSidebar', 'studies');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user