Accepting numeric values on common labels

This commit is contained in:
Bruno Alves de Faria 2017-10-12 13:25:22 -03:00
parent 15f04a5790
commit 6fdfd27fe5
3 changed files with 6 additions and 4 deletions

View File

@ -17,4 +17,4 @@ Template.registerHelper('concat', (...args) => {
});
// Encode any string into a safe format for HTML id attribute
Template.registerHelper('encodeId', string => OHIF.string.encodeId(string));
Template.registerHelper('encodeId', OHIF.string.encodeId);

View File

@ -35,7 +35,9 @@ OHIF.string.search = (object, query, property=null, result=[]) => {
};
// Encode any string into a safe format for HTML id attribute
OHIF.string.encodeId = string => {
OHIF.string.encodeId = input => {
const string = input && input.toString ? input.toString() : input;
// Return an underscore if the given string is empty or if it's not a string
if (string === '' || typeof string !== 'string') {
return '_';

View File

@ -1,6 +1,6 @@
import { OHIF } from 'meteor/ohif:core';
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { _ } from 'meteor/underscore';
import { Tracker } from 'meteor/tracker';
Template.selectTreeCommon.events({
'click .select-tree-common label'(event, instance) {