feat(user preferences) Add User Preferences & Theming to Standalone Viewer (closes #117). Update Standalone to Meteor 1.7

This commit is contained in:
Erik Ziegler committed 2018-07-04 17:43:50 +02:00
1 parent 7090b4f3e0
commit de7135f3b8
32 files changed
+337 -250

No files matched your search

@@ -13,6 +13,12 @@ Template.ohifViewer.onCreated(() => {
text: 'Server Information',
icon: 'fa fa-server fa-lg',
separatorAfter: true
}, {
action: () => OHIF.ui.showDialog('themeSelectorModal'),
text: 'Themes',
iconClasses: 'theme',
iconSvgUse: 'packages/ohif_viewerbase/assets/icons.svg#theme',
separatorAfter: false
}, {
action: () => OHIF.ui.showDialog('userPreferencesDialog'),
text: 'Preferences',
@@ -1,20 +0,0 @@
<template name="userPreferencesDialog">
{{#dialogSimple (extend this class='themed' dialogClass='dialog-user-preferences modal-lg' title='User Preferences')}}
<div class="dialog-separator-after">
<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/Levels</a>
</li>
</ul>
</div>
<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>
@@ -1,22 +0,0 @@
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' : '';
}
});
@@ -1,79 +0,0 @@
@require '{ohif:design}/app'
.dialog-user-preferences
.modal-body
overflow: hidden
.form-content
theme('border-bottom', '1px solid $uiBorderColor')
margin-bottom: 10px
margin-left: -15px
margin-right: -15px
max-height: 70vh
overflow-y: auto
padding: 15px
.popover
width: 300px
.nav-tabs
border-bottom: 0
margin-bottom: 3px
position: relative
z-index: 1
&>li
font-size: 14px
font-weight: normal
height: 40px
line-height: 40px
margin-bottom: 0
&>a
display: block
width: 100%
line-height: inherit
margin: 0
height: inherit
padding: 0 10px 0 10px
&:after
background-color: transparent
bottom: -3px
content: ' '
display: block
height: 3px
transition(background-color 0.3s ease)
width: 100%
&>a, &.active>a
&, &:hover, &:active, &:focus
theme('color', '$activeColor')
background-color: transparent
border: 0
&.active>a
font-weight: bold
&:after
theme('background-color', '$activeColor')
.form-themed
table
color: #fff
th, td
font-size: 14px
font-weight: 300
th
line-height: 60px
td
line-height: 20px
input[type=text]
font-weight: 300