PWV-1: Refactoring ohif:studylist package

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2016-11-15 08:24:01 +01:00
1 parent 984ef94403
commit 4d79bf84a8
79 files changed
+450 -551

No files matched your search

@@ -0,0 +1,3 @@
<template name="dropdownBackdrop">
<div class="dropdown-backdrop"></div>
</template>
@@ -0,0 +1,8 @@
<template name="dropdownForm">
{{#form class='dropdown' api=this.api hideValidationBox=true}}
{{>dropdownBackdrop}}
<ul class="dropdown-menu">
{{>UI.contentBlock}}
</ul>
{{/form}}
</template>
@@ -0,0 +1,25 @@
import { Template } from 'meteor/templating';
import { Blaze } from 'meteor/blaze';
import { _ } from 'meteor/underscore';
Template.dropdownForm.onRendered(() => {
const instance = Template.instance();
// Show the dropdown
instance.$('.dropdown').addClass('open');
// Destroy the Blaze created view (either created with template calls or with renderWithData)
instance.destroyView = () => {
if (_.isFunction(instance.data.destroyView)) {
instance.data.destroyView();
} else {
Blaze.remove(instance.view);
}
};
});
Template.dropdownForm.events({
'click .dropdown'(event, instance) {
instance.destroyView();
}
});