Adapting header to the new structure

This commit is contained in:
Bruno Alves de Faria committed 2017-03-21 10:16:47 -03:00
1 parent 2d52c9ef0a
commit e83b5348ff
34 files changed
+395 -154

No files matched your search

@@ -0,0 +1,14 @@
<template name="header">
<div class="header noselect {{reactive headerClasses}}">
<div class="clearfix">
<a target='_blank' class="brand pull-left" href="{{choose this.brandHref '/'}}">
{{>section 'brand'}}
</a>
{{>section 'headerAfterBrand'}}
<a href='#' class="header-menu pull-right">
{{>section 'headerMenu'}}
</a>
</div>
{{>UI.contentBlock}}
</div>
</template>
@@ -0,0 +1,37 @@
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import { $ } from 'meteor/jquery';
import { OHIF } from 'meteor/ohif:core';
Template.header.onCreated(() => {
const instance = Template.instance();
instance.dropdownOpen = new ReactiveVar(false);
instance.dropdownItems = [];
instance.autorun(() => {
OHIF.header.dropdownObserver.depend();
instance.dropdownItems = OHIF.header.getDropdownItems();
});
});
Template.header.events({
'mousedown .header-menu'(event, instance) {
if (instance.dropdownOpen.get()) {
event.preventDefault();
return $(event.currentTarget).focus();
}
},
'click .header-menu'(event, instance) {
event.preventDefault();
if (instance.dropdownOpen.get()) return;
instance.dropdownOpen.set(true);
const closeHandler = () => Meteor.setTimeout(() => instance.dropdownOpen.set(false), 200);
OHIF.ui.showDropdown(instance.dropdownItems, {
parentElement: event.currentTarget,
menuClasses: 'dropdown-menu-right',
marginTop: '25px'
}).then(closeHandler).catch(closeHandler);
}
});
@@ -0,0 +1,23 @@
@import "{ohif:design}/app"
body>.header
height: $topBarHeight
padding: 10px 10px 0
theme('color', '$textPrimaryColor')
theme('background-color', '$primaryBackgroundColor')
transition(all 0.5s ease)
&>.clearfix
position: relative
.header-menu
padding: 4px 0
font-size: 13px
font-weight: 400
line-height: 18px
text-decoration: none
theme('color', '$defaultColor')
&.header-big
height: $topBarExpandedHeight
background-color: rgba(21, 25, 30, 0.7)
@@ -0,0 +1,3 @@
import './header/header.html';
import './header/header.js';
import './header/header.styl';