diff --git a/LesionTracker/client/components/app/app.js b/LesionTracker/client/components/app/app.js index 2840549ec..5bbb8c794 100644 --- a/LesionTracker/client/components/app/app.js +++ b/LesionTracker/client/components/app/app.js @@ -26,6 +26,11 @@ Template.app.onCreated(() => { iconClasses: 'server', iconSvgUse: 'packages/ohif_user-management/assets/user-menu-icons.svg#server', separatorAfter: true + }, { + action: () => OHIF.ui.showDialog('userPreferencesDialog'), + text: 'Preferences', + icon: 'fa fa-user', + separatorAfter: true }, { action: OHIF.user.changePassword, text: 'Change Password', diff --git a/LesionTracker/client/components/userPreferences/dialog.html b/LesionTracker/client/components/userPreferences/dialog.html new file mode 100644 index 000000000..d04279ede --- /dev/null +++ b/LesionTracker/client/components/userPreferences/dialog.html @@ -0,0 +1,18 @@ + diff --git a/LesionTracker/client/components/userPreferences/dialog.js b/LesionTracker/client/components/userPreferences/dialog.js new file mode 100644 index 000000000..4a0366d41 --- /dev/null +++ b/LesionTracker/client/components/userPreferences/dialog.js @@ -0,0 +1,22 @@ +import { Template } from 'meteor/templating'; +import { ReactiveVar } from 'meteor/reactive-var'; + +Template.userPreferencesDialog.onCreated(() => { + const instance = Template.instance(); + instance.activeTab = new ReactiveVar('hotkeys'); +}); + +Template.userPreferencesDialog.events({ + 'click .nav-tabs li a'(event, instance) { + const tabId = $(event.currentTarget).attr('data-id'); + instance.activeTab.set(tabId); + } +}); + +Template.userPreferencesDialog.helpers({ + tabClasses(tabId) { + const instance = Template.instance(); + const activeTab = instance.activeTab.get(); + return tabId === activeTab ? 'active' : ''; + } +}); diff --git a/LesionTracker/client/components/userPreferences/dialog.styl b/LesionTracker/client/components/userPreferences/dialog.styl new file mode 100644 index 000000000..78fb147cc --- /dev/null +++ b/LesionTracker/client/components/userPreferences/dialog.styl @@ -0,0 +1,14 @@ +@require '{ohif:design}/app' + +.dialog-user-preferences + + .form-content + margin-bottom: 10px + margin-left: -15px + margin-right: -15px + max-height: 70vh + overflow-y: auto + padding: 15px + + .popover + width: 300px diff --git a/OHIFViewer/client/components/ohifViewer/ohifViewer.js b/OHIFViewer/client/components/ohifViewer/ohifViewer.js index 6806cff8d..ac8bd7677 100644 --- a/OHIFViewer/client/components/ohifViewer/ohifViewer.js +++ b/OHIFViewer/client/components/ohifViewer/ohifViewer.js @@ -13,6 +13,11 @@ Template.ohifViewer.onCreated(() => { text: 'Server Information', icon: 'fa fa-server fa-lg', separatorAfter: true + }, { + action: () => OHIF.ui.showDialog('userPreferencesDialog'), + text: 'Preferences', + icon: 'fa fa-user', + separatorAfter: true }, { action: () => OHIF.ui.showDialog('aboutModal'), text: 'About', diff --git a/OHIFViewer/client/components/userPreferences/dialog.html b/OHIFViewer/client/components/userPreferences/dialog.html new file mode 100644 index 000000000..d04279ede --- /dev/null +++ b/OHIFViewer/client/components/userPreferences/dialog.html @@ -0,0 +1,18 @@ + diff --git a/OHIFViewer/client/components/userPreferences/dialog.js b/OHIFViewer/client/components/userPreferences/dialog.js new file mode 100644 index 000000000..4a0366d41 --- /dev/null +++ b/OHIFViewer/client/components/userPreferences/dialog.js @@ -0,0 +1,22 @@ +import { Template } from 'meteor/templating'; +import { ReactiveVar } from 'meteor/reactive-var'; + +Template.userPreferencesDialog.onCreated(() => { + const instance = Template.instance(); + instance.activeTab = new ReactiveVar('hotkeys'); +}); + +Template.userPreferencesDialog.events({ + 'click .nav-tabs li a'(event, instance) { + const tabId = $(event.currentTarget).attr('data-id'); + instance.activeTab.set(tabId); + } +}); + +Template.userPreferencesDialog.helpers({ + tabClasses(tabId) { + const instance = Template.instance(); + const activeTab = instance.activeTab.get(); + return tabId === activeTab ? 'active' : ''; + } +}); diff --git a/OHIFViewer/client/components/userPreferences/dialog.styl b/OHIFViewer/client/components/userPreferences/dialog.styl new file mode 100644 index 000000000..78fb147cc --- /dev/null +++ b/OHIFViewer/client/components/userPreferences/dialog.styl @@ -0,0 +1,14 @@ +@require '{ohif:design}/app' + +.dialog-user-preferences + + .form-content + margin-bottom: 10px + margin-left: -15px + margin-right: -15px + max-height: 70vh + overflow-y: auto + padding: 15px + + .popover + width: 300px diff --git a/Packages/ohif-hotkeys/client/classes/HotkeysManager.js b/Packages/ohif-hotkeys/client/classes/HotkeysManager.js index 6512f46d5..3ca63617c 100644 --- a/Packages/ohif-hotkeys/client/classes/HotkeysManager.js +++ b/Packages/ohif-hotkeys/client/classes/HotkeysManager.js @@ -86,7 +86,9 @@ export class HotkeysManager { return reject(); } - context.extend(definitions); + context.destroy(); + context.definitions = definitions; + context.initialize(); this.changeObserver.changed(); resolve(definitions); }).catch(reject);