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,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'
});
}
});