Improving window level presets preferences

This commit is contained in:
Bruno Alves de Faria 2017-10-04 16:00:29 -03:00
parent b9b9a0f00d
commit ac69233025
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<template name="windowLevelPresetsForm">
{{#form (extend this api=instance.api class='form-themed')}}
{{#form (extend api=instance.api class='form-themed')}}
<div class="form-content">
<table class="full-width">
<thead>
@ -25,6 +25,7 @@
<div class="form-buttons clearfix">
{{#button class='btn btn-danger pull-left' action='resetDefaults'}}Reset to Defaults{{/button}}
{{#button class='btn btn-primary pull-right' action='save'}}Save{{/button}}
{{#button class='btn btn-secondary pull-right m-r-1' tagAttributes=(extend '' data-dismiss='modal')}}Close{{/button}}
</div>
{{/form}}
</template>

View File

@ -10,7 +10,11 @@ Template.windowLevelPresetsForm.onCreated(() => {
save() {
const form = instance.$('form').first().data('component');
const definitions = form.value();
wlPresets.store(definitions);
const promise = wlPresets.store(definitions);
promise.then(() => OHIF.ui.notifications.success({
text: 'The Window/Levels preferences were successfully saved.'
}));
return promise;
},
resetDefaults() {