Allowing W/L Presets customization
This commit is contained in:
1 parent
4d9300f6c4
commit
e6b5a21ae2
14 files changed
+303
-173
No files matched your search
@@ -1,14 +1,16 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { _ } from 'meteor/underscore';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
Template.windowLevelPresetsForm.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
const { wlPresets } = OHIF.viewerbase;
|
||||
|
||||
instance.api = {
|
||||
save() {
|
||||
const form = instance.$('form').first().data('component');
|
||||
const definitions = form.value();
|
||||
// TODO: return save method with promise
|
||||
wlPresets.store(definitions);
|
||||
},
|
||||
|
||||
resetDefaults() {
|
||||
@@ -17,9 +19,14 @@ Template.windowLevelPresetsForm.onCreated(() => {
|
||||
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
|
||||
});
|
||||
return OHIF.ui.showDialog('dialogConfirm', dialogOptions).then(() => wlPresets.resetDefaults());
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
Template.windowLevelPresetsForm.helpers({
|
||||
getPresetsInputInformationList() {
|
||||
OHIF.viewerbase.wlPresets.changeObserver.depend();
|
||||
return _.toArray(OHIF.viewer.wlPresets);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user