Move ohif:header into ohif:core

This commit is contained in:
Erik Ziegler committed 2018-12-12 09:10:53 +01:00
1 parent 54a0f447b5
commit 700fff763c
7 files changed
+3 -4

No files matched your search

@@ -0,0 +1,12 @@
<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,29 @@
import { Template } from 'meteor/templating';
import { $ } from 'meteor/jquery';
import { OHIF } from 'meteor/ohif:core';
Template.header.onCreated(() => {
const instance = Template.instance();
instance.dropdownItems = [];
instance.autorun(() => {
OHIF.header.dropdown.observer.depend();
instance.dropdownItems = OHIF.header.dropdown.getItems();
});
});
Template.header.events({
'click .header-menu'(event, instance) {
event.preventDefault();
// Prevent dropdown from being opened if there's one already opened
if ($(event.currentTarget).find('.dropdown').length) return;
// Show the dropdown
OHIF.ui.showDropdown(instance.dropdownItems, {
parentElement: event.currentTarget,
menuClasses: 'dropdown-menu-right',
marginTop: '25px'
});
}
});
@@ -0,0 +1,26 @@
@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')
&:empty
display: none
&.header-big
height: $topBarExpandedHeight
background-color: rgba(21, 25, 30, 0.7)
@@ -0,0 +1,3 @@
import './header.html';
import './header.js';
import './header.styl';