Adding user preferences to LT and Viewer

This commit is contained in:
Bruno Alves de Faria committed 2017-06-14 16:10:44 -03:00
1 parent 3d081fe297
commit e8d729c9b0
9 files changed
+121 -1

No files matched your search

@@ -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',
@@ -0,0 +1,18 @@
<template name="userPreferencesDialog">
{{#dialogSimple (extend this class='themed' dialogClass='dialog-user-preferences modal-lg' title='User Preferences')}}
<ul class="nav nav-tabs">
<li role="presentation" class="{{tabClasses 'hotkeys'}}">
<a href="#" data-id="hotkeys">Keyboard Shortcuts</a>
</li>
<li role="presentation" class="{{tabClasses 'wwwc'}}">
<a href="#" data-id="wwwc">Window W/L</a>
</li>
</ul>
<div class="{{#unless eq instance.activeTab.get 'hotkeys'}}hidden{{/unless}}">
{{>hotkeysForm (extend contextName='viewer')}}
</div>
<div class="{{#unless eq instance.activeTab.get 'wwwc'}}hidden{{/unless}}">
{{>windowLevelPresetsForm}}
</div>
{{/dialogSimple}}
</template>
@@ -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' : '';
}
});
@@ -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