Accepting numeric values on common labels

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

No files matched your search

+1 -1
View File
@@ -17,4 +17,4 @@ Template.registerHelper('concat', (...args) => {
}); });
// Encode any string into a safe format for HTML id attribute // 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);
+3 -1
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 // 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 // Return an underscore if the given string is empty or if it's not a string
if (string === '' || typeof string !== 'string') { if (string === '' || typeof string !== 'string') {
return '_'; return '_';
@@ -1,6 +1,6 @@
import { OHIF } from 'meteor/ohif:core'; import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating'; import { Template } from 'meteor/templating';
import { _ } from 'meteor/underscore'; import { Tracker } from 'meteor/tracker';
Template.selectTreeCommon.events({ Template.selectTreeCommon.events({
'click .select-tree-common label'(event, instance) { 'click .select-tree-common label'(event, instance) {