Creating Window Level Presets form
This commit is contained in:
parent
22f1e659fa
commit
4d9300f6c4
@ -1,5 +1,7 @@
|
|||||||
<template name="hotkeysDialog">
|
<template name="hotkeysDialog">
|
||||||
{{#dialogSimple (extend this dialogClass='dialog-hotkeys' title='Keyboard Shortcuts')}}
|
{{#dialogSimple (extend this dialogClass='dialog-hotkeys' title='Keyboard Shortcuts')}}
|
||||||
{{>hotkeysForm this}}
|
{{>hotkeysForm this}}
|
||||||
|
<hr>
|
||||||
|
{{>windowLevelPresetsForm this}}
|
||||||
{{/dialogSimple}}
|
{{/dialogSimple}}
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -120,13 +120,14 @@ Template.hotkeysForm.helpers({
|
|||||||
const commandsContext = OHIF.commands.getContext(contextName);
|
const commandsContext = OHIF.commands.getContext(contextName);
|
||||||
if (!hotkeysContext || !commandsContext) return hotkeysInputInformation;
|
if (!hotkeysContext || !commandsContext) return hotkeysInputInformation;
|
||||||
const hotkeyDefinitions = hotkeysContext.definitions;
|
const hotkeyDefinitions = hotkeysContext.definitions;
|
||||||
_.each(hotkeyDefinitions, (keyCombination, commandName) => {
|
const commands = Object.keys(OHIF.hotkeys.defaults[contextName] || {});
|
||||||
|
commands.forEach(commandName => {
|
||||||
const commandDefinitions = commandsContext[commandName];
|
const commandDefinitions = commandsContext[commandName];
|
||||||
if (!commandDefinitions) return;
|
if (!commandDefinitions) return;
|
||||||
hotkeysInputInformation.push({
|
hotkeysInputInformation.push({
|
||||||
key: commandName,
|
key: commandName,
|
||||||
label: commandDefinitions.name,
|
label: commandDefinitions.name,
|
||||||
value: keyCombination
|
value: hotkeyDefinitions[commandName] || ''
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return hotkeysInputInformation;
|
return hotkeysInputInformation;
|
||||||
|
|||||||
@ -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
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
@ -402,9 +402,6 @@ export const toolManager = {
|
|||||||
toolManager.init();
|
toolManager.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent changing if tool is already active
|
|
||||||
if (tool === toolManager.getActiveTool()) return;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Add textMarkerDialogs template to OHIF's
|
* TODO: Add textMarkerDialogs template to OHIF's
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -191,6 +191,9 @@ Package.onUse(function(api) {
|
|||||||
api.addFiles('client/components/viewer/studyTimepointBrowser/studyTimepointStudy.styl', 'client');
|
api.addFiles('client/components/viewer/studyTimepointBrowser/studyTimepointStudy.styl', 'client');
|
||||||
api.addFiles('client/components/viewer/studyTimepointBrowser/studyTimepointStudy.js', 'client');
|
api.addFiles('client/components/viewer/studyTimepointBrowser/studyTimepointStudy.js', 'client');
|
||||||
|
|
||||||
|
api.addFiles('client/components/viewer/windowLevelPresets/form.html', 'client');
|
||||||
|
api.addFiles('client/components/viewer/windowLevelPresets/form.js', 'client');
|
||||||
|
|
||||||
api.export('dialogPolyfill', 'client');
|
api.export('dialogPolyfill', 'client');
|
||||||
|
|
||||||
api.mainModule('main.js', 'client');
|
api.mainModule('main.js', 'client');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user