PWV-30: Adding preset name to shortcuts preferences

This commit is contained in:
Bruno Alves de Faria 2017-06-09 16:36:32 -03:00 committed by Erik Ziegler
parent 66c27b408f
commit 0be312b787
3 changed files with 21 additions and 1 deletions

View File

@ -9,7 +9,7 @@
<tbody>
{{#each input in this.inputs}}
<tr>
<td class="text-right p-r-1">{{input.label}}</td>
<td class="text-right p-r-1">{{getLabel input}}</td>
<td width="200">{{>inputText (extend class='hotkey text-center' key=input.key value=input.value)}}</td>
</tr>
{{/each}}

View File

@ -0,0 +1,17 @@
import { Template } from 'meteor/templating';
import { OHIF } from 'meteor/ohif:core';
Template.hotkeysFormTable.helpers({
getLabel(input) {
let result = input.label;
if (input.key.indexOf('WLPreset') === 0) {
const presetIndex = parseInt(input.key.replace('WLPreset', ''));
const preset = OHIF.viewer.wlPresets[presetIndex];
if (preset.id) {
result += ` (${preset.id})`;
}
}
return result;
}
});

View File

@ -1,4 +1,7 @@
import './confirmReplacementPopover.html';
import './form.html';
import './form.js';
import './formTable.html';
import './formTable.js';