From 479e42017906eff26bcd240dc03f6cca63ed4c8b Mon Sep 17 00:00:00 2001 From: Bruno Alves de Faria Date: Sat, 20 Aug 2016 10:09:31 -0300 Subject: [PATCH] Opening series sidebar by default --- .../toolbarSection/toolbarSection.html | 6 ++--- .../toolbarSection/toolbarSection.js | 14 +++++++++-- .../client/components/viewer/viewer.html | 20 ++++++++-------- .../lesionTrackerWorklistContextMenu.html | 4 ++-- .../lesionTrackerWorklistContextMenu.js | 8 ------- Packages/ohif-core/client/helpers/index.js | 1 + Packages/ohif-core/client/helpers/ui.js | 11 +++++++++ Packages/ohif-core/client/lib/index.js | 1 + Packages/ohif-core/client/lib/ui.js | 6 +++++ Packages/worklist/both/schema.js | 7 +++++- .../studyContextMenu/studyContextMenu.html | 4 ++-- .../studyContextMenu/studyContextMenu.js | 7 ------ .../worklistToolbar/worklistToolbar.js | 24 +++++++++---------- config/orthancDICOMWeb.json | 3 ++- 14 files changed, 68 insertions(+), 48 deletions(-) create mode 100644 Packages/ohif-core/client/helpers/ui.js create mode 100644 Packages/ohif-core/client/lib/ui.js diff --git a/OHIFViewer/client/components/toolbarSection/toolbarSection.html b/OHIFViewer/client/components/toolbarSection/toolbarSection.html index 077cc9c28..fe062ac84 100644 --- a/OHIFViewer/client/components/toolbarSection/toolbarSection.html +++ b/OHIFViewer/client/components/toolbarSection/toolbarSection.html @@ -4,14 +4,14 @@
{{>roundedButtonGroup leftSidebarToggleButtonData}}
- {{> toolbarSectionTools + {{>toolbarSectionTools toolbarButtons=toolbarButtons extraToolbarButtons=extraToolbarButtons}}
- {{> roundedButtonGroup rightSidebarToggleButtonData}} + {{>roundedButtonGroup rightSidebarToggleButtonData}}
- {{> toolbarSectionTools toolbarButtons=hangingProtocolButtons}} + {{>toolbarSectionTools toolbarButtons=hangingProtocolButtons}}
diff --git a/OHIFViewer/client/components/toolbarSection/toolbarSection.js b/OHIFViewer/client/components/toolbarSection/toolbarSection.js index 1c6c80762..8f34ac230 100644 --- a/OHIFViewer/client/components/toolbarSection/toolbarSection.js +++ b/OHIFViewer/client/components/toolbarSection/toolbarSection.js @@ -1,4 +1,14 @@ import { OHIF } from 'meteor/ohif:core'; +import { Template } from 'meteor/templating'; +import { $ } from 'meteor/jquery'; + +Template.toolbarSection.onCreated(() => { + const instance = Template.instance(); + + if (OHIF.uiSettings.leftSidebarOpen) { + instance.data.state.set('leftSidebar', 'studies'); + } +}); Template.toolbarSection.helpers({ leftSidebarToggleButtonData() { @@ -122,7 +132,7 @@ Template.toolbarSection.helpers({ classes: 'imageViewerTool toolbarSectionButton', iconClasses: 'fa fa-circle' }); - + buttonData.push({ id: 'wwwcRegion', title: 'ROI Window', @@ -165,7 +175,7 @@ Template.toolbarSection.helpers({ iconClasses: 'fa fa-trash' }); - return buttonData; + return buttonData; }, hangingProtocolButtons() { diff --git a/OHIFViewer/client/components/viewer/viewer.html b/OHIFViewer/client/components/viewer/viewer.html index cd9d8fb68..fb4ab5b2c 100644 --- a/OHIFViewer/client/components/viewer/viewer.html +++ b/OHIFViewer/client/components/viewer/viewer.html @@ -1,20 +1,20 @@ \ No newline at end of file + diff --git a/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.html b/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.html index b24e896c8..44c8d699d 100644 --- a/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.html +++ b/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.html @@ -1,5 +1,5 @@ \ No newline at end of file + diff --git a/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.js b/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.js index e9a66b178..fae8ecec4 100644 --- a/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.js +++ b/Packages/lesiontracker/client/components/lesionTrackerWorklistContextMenu/lesionTrackerWorklistContextMenu.js @@ -173,11 +173,3 @@ function viewStudies() { // Switch to the new tab switchToTab(contentid); } - -Template.studyContextMenu.helpers({ - 'studyListFunctionsEnabled': function() { - var studyListFunctionsEnabled = Meteor.settings && Meteor.settings.public && Meteor.settings.public.ui && - Meteor.settings.public.ui.studyListFunctionsEnabled || false; - return studyListFunctionsEnabled; - } -}); \ No newline at end of file diff --git a/Packages/ohif-core/client/helpers/index.js b/Packages/ohif-core/client/helpers/index.js index 0d9c7683d..d0167cc05 100644 --- a/Packages/ohif-core/client/helpers/index.js +++ b/Packages/ohif-core/client/helpers/index.js @@ -5,3 +5,4 @@ import './logical.js'; import './number.js'; import './string.js'; import './typing.js'; +import './ui.js'; diff --git a/Packages/ohif-core/client/helpers/ui.js b/Packages/ohif-core/client/helpers/ui.js new file mode 100644 index 000000000..ad8bfffbc --- /dev/null +++ b/Packages/ohif-core/client/helpers/ui.js @@ -0,0 +1,11 @@ +import { OHIF } from 'meteor/ohif:core'; +import { Template } from 'meteor/templating'; + +/** + * Global Blaze UI helpers + */ + +// Access OHIF.uiSettings object +Template.registerHelper('uiSettings', () => { + return OHIF.uiSettings; +}); diff --git a/Packages/ohif-core/client/lib/index.js b/Packages/ohif-core/client/lib/index.js index 1699c91cd..56c8d9f11 100644 --- a/Packages/ohif-core/client/lib/index.js +++ b/Packages/ohif-core/client/lib/index.js @@ -1,3 +1,4 @@ import './blaze.js'; import './string.js'; +import './ui.js'; import './user.js'; diff --git a/Packages/ohif-core/client/lib/ui.js b/Packages/ohif-core/client/lib/ui.js new file mode 100644 index 000000000..1598ccc49 --- /dev/null +++ b/Packages/ohif-core/client/lib/ui.js @@ -0,0 +1,6 @@ +import { OHIF } from 'meteor/ohif:core'; +import { Meteor } from 'meteor/meteor'; + +// Get the UI settings +const ui = Meteor.settings && Meteor.settings.public && Meteor.settings.public.ui; +OHIF.uiSettings = ui || {}; diff --git a/Packages/worklist/both/schema.js b/Packages/worklist/both/schema.js index 78ad516a0..a5ac2d87f 100644 --- a/Packages/worklist/both/schema.js +++ b/Packages/worklist/both/schema.js @@ -14,7 +14,7 @@ export const DICOMWebRequestOptions = new SimpleSchema({ logResponses: { type: Boolean, defaultValue: false, - label: 'Log Responses?', + label: 'Log Responses?', }, logTiming: { type: Boolean, @@ -116,6 +116,11 @@ export const UISettings = new SimpleSchema({ type: Boolean, label: 'Study List Functions Enabled?', defaultValue: true + }, + leftSidebarOpen: { + type: Boolean, + label: 'Left sidebar open by default?', + defaultValue: false } }); diff --git a/Packages/worklist/client/components/studyContextMenu/studyContextMenu.html b/Packages/worklist/client/components/studyContextMenu/studyContextMenu.html index 0326400b4..8c07fc01d 100644 --- a/Packages/worklist/client/components/studyContextMenu/studyContextMenu.html +++ b/Packages/worklist/client/components/studyContextMenu/studyContextMenu.html @@ -1,5 +1,5 @@ \ No newline at end of file + diff --git a/Packages/worklist/client/components/studyContextMenu/studyContextMenu.js b/Packages/worklist/client/components/studyContextMenu/studyContextMenu.js index d6f8c647d..048c2f2c0 100644 --- a/Packages/worklist/client/components/studyContextMenu/studyContextMenu.js +++ b/Packages/worklist/client/components/studyContextMenu/studyContextMenu.js @@ -82,10 +82,3 @@ Template.studyContextMenu.events({ closeHandler(dialog); } }); - -Template.studyContextMenu.helpers({ - 'studyListFunctionsEnabled': function() { - var studyListFunctionsEnabled = Meteor.settings && Meteor.settings.public && Meteor.settings.public.ui && - Meteor.settings.public.ui.studyListFunctionsEnabled || false; return studyListFunctionsEnabled; - } -}); \ No newline at end of file diff --git a/Packages/worklist/client/components/worklistToolbar/worklistToolbar.js b/Packages/worklist/client/components/worklistToolbar/worklistToolbar.js index 6d056af5c..6087155ba 100644 --- a/Packages/worklist/client/components/worklistToolbar/worklistToolbar.js +++ b/Packages/worklist/client/components/worklistToolbar/worklistToolbar.js @@ -1,3 +1,9 @@ +import { OHIF } from 'meteor/ohif:core'; +import { Template } from 'meteor/templating'; +import { Meteor } from 'meteor/meteor'; +import { Session } from 'meteor/session'; +import { $ } from 'meteor/jquery'; + Template.worklistToolbar.onCreated(() => { Meteor.call('importSupported', (error, result) => { if (error || !result) { @@ -11,26 +17,20 @@ Template.worklistToolbar.onCreated(() => { Template.worklistToolbar.events({ 'change .js-import-files'(event) { // Get selected files located in the client machine - var selectedFiles = $.map(event.currentTarget.files, (value) => { - return value; - }); - + const selectedFiles = $.map(event.currentTarget.files, value => value); + importStudies(selectedFiles); }, 'click .js-import-files'(event) { // Reset file input - var fileInput = event.currentTarget; - $(fileInput).val(''); + $(event.currentTarget).val(''); } }); Template.worklistToolbar.helpers({ importSupported() { - var importSupported = Session.get('importSupported'); - var studyListFunctionsEnabled = Meteor.settings && Meteor.settings.public && Meteor.settings.public.ui && - Meteor.settings.public.ui.studyListFunctionsEnabled || false; - - return (importSupported && studyListFunctionsEnabled); + const importSupported = Session.get('importSupported'); + return (importSupported && OHIF.uiSettings.studyListFunctionsEnabled); } -}); \ No newline at end of file +}); diff --git a/config/orthancDICOMWeb.json b/config/orthancDICOMWeb.json index ee2f1a1f2..74be118d2 100644 --- a/config/orthancDICOMWeb.json +++ b/config/orthancDICOMWeb.json @@ -22,7 +22,8 @@ "public": { "verifyEmail": false, "ui": { - "studyListFunctionsEnabled": true + "studyListFunctionsEnabled": true, + "leftSidebarOpen": true } } }