PWV-15: Updating Viewer Data inside viewer.js
This commit is contained in:
parent
2ea2107e11
commit
374dab5ef4
@ -44,9 +44,6 @@ Template.app.onCreated(() => {
|
|||||||
const routeName = currentRoute.route.getName();
|
const routeName = currentRoute.route.getName();
|
||||||
const isViewer = routeName.indexOf('viewer') === 0;
|
const isViewer = routeName.indexOf('viewer') === 0;
|
||||||
|
|
||||||
// Define the OHIF.viewer.data global object
|
|
||||||
OHIF.viewer.data = OHIF.viewer.data || Session.get('ViewerData') || {};
|
|
||||||
|
|
||||||
// Add or remove the strech class from body
|
// Add or remove the strech class from body
|
||||||
$(document.body)[isViewer ? 'addClass' : 'removeClass']('stretch');
|
$(document.body)[isViewer ? 'addClass' : 'removeClass']('stretch');
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,9 @@ Template.viewer.onCreated(() => {
|
|||||||
|
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
|
|
||||||
|
// Define the OHIF.viewer.data global object
|
||||||
|
OHIF.viewer.data = OHIF.viewer.data || Session.get('ViewerData') || {};
|
||||||
|
|
||||||
const { TimepointApi, MeasurementApi, ConformanceCriteria } = OHIF.measurements;
|
const { TimepointApi, MeasurementApi, ConformanceCriteria } = OHIF.measurements;
|
||||||
|
|
||||||
const currentTimepointId = OHIF.viewer.data.currentTimepointId;
|
const currentTimepointId = OHIF.viewer.data.currentTimepointId;
|
||||||
|
|||||||
@ -8,9 +8,6 @@ Template.ohifViewer.onCreated(() => {
|
|||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
instance.headerClasses = new ReactiveVar('');
|
instance.headerClasses = new ReactiveVar('');
|
||||||
|
|
||||||
// Define the OHIF.viewer.data global object
|
|
||||||
OHIF.viewer.data = instance.data.viewerData || {};
|
|
||||||
|
|
||||||
OHIF.header.dropdown.setItems([{
|
OHIF.header.dropdown.setItems([{
|
||||||
action: () => OHIF.ui.showDialog('serverInformationModal'),
|
action: () => OHIF.ui.showDialog('serverInformationModal'),
|
||||||
text: 'Server Information',
|
text: 'Server Information',
|
||||||
|
|||||||
@ -80,6 +80,9 @@ Template.viewer.onCreated(() => {
|
|||||||
|
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
|
|
||||||
|
// Define the OHIF.viewer.data global object
|
||||||
|
OHIF.viewer.data = OHIF.viewer.data || Session.get('ViewerData') || {};
|
||||||
|
|
||||||
instance.data.state = new ReactiveDict();
|
instance.data.state = new ReactiveDict();
|
||||||
instance.data.state.set('leftSidebar', Session.get('leftSidebar'));
|
instance.data.state.set('leftSidebar', Session.get('leftSidebar'));
|
||||||
instance.data.state.set('rightSidebar', Session.get('rightSidebar'));
|
instance.data.state.set('rightSidebar', Session.get('rightSidebar'));
|
||||||
@ -99,6 +102,9 @@ Template.viewer.onCreated(() => {
|
|||||||
OHIF.viewer.data.activeViewport = 0;
|
OHIF.viewer.data.activeViewport = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Store the viewer data in session for further user
|
||||||
|
Session.setPersistent('ViewerData', OHIF.viewer.data);
|
||||||
|
|
||||||
Session.set('activeViewport', OHIF.viewer.data.activeViewport || 0);
|
Session.set('activeViewport', OHIF.viewer.data.activeViewport || 0);
|
||||||
|
|
||||||
// @TypeSafeStudies
|
// @TypeSafeStudies
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user