Creating Window Level Presets form

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2017-06-14 09:19:49 +02:00
1 parent 22f1e659fa
commit 4d9300f6c4
6 files changed
+43 -5

No files matched your search

@@ -0,0 +1,10 @@
<template name="windowLevelPresetsForm">
{{#form (extend this class='form-themed' api=instance.api)}}
{{>inputText label='W/L Preset 1' key='WLPreset1'}}
<hr>
<div class="clearfix">
{{#button class='btn btn-primary pull-right' action='save'}}Save{{/button}}
{{#button class='btn btn-secondary pull-right m-r-1' action='resetDefaults'}}Reset to Defaults{{/button}}
</div>
{{/form}}
</template>
@@ -0,0 +1,25 @@
import { Template } from 'meteor/templating';
import { OHIF } from 'meteor/ohif:core';
Template.windowLevelPresetsForm.onCreated(() => {
const instance = Template.instance();
instance.api = {
save() {
const form = instance.$('form').first().data('component');
const definitions = form.value();
// TODO: return save method with promise
},
resetDefaults() {
const dialogOptions = {
title: 'Reset Window Level Presets to Default',
message: 'Are you sure you want to reset all the window level presets to their defaults?'
};
return OHIF.ui.showDialog('dialogConfirm', dialogOptions).then(() => {
// TODO: return reset method with promise
});
}
};
});