Fix duplicate helper bugs in Lesion Tracker

This commit is contained in:
Erik Ziegler committed 2016-08-05 10:09:12 +02:00
1 parent 9bf96f24d7
commit f963fec586
19 files changed
+124 -181

No files matched your search

@@ -24,10 +24,10 @@
</div>
</div>
<hr>
{{#if equals this.serverType.get "dicomWeb"}}
{{#if eq this.serverType.get "dicomWeb"}}
{{>serverInformationDicomWeb this}}
{{/if}}
{{#if equals this.serverType.get "dimse"}}
{{#if eq this.serverType.get "dimse"}}
{{>serverInformationDimse this}}
{{/if}}
{{#if this.serverType.get}}
@@ -2,7 +2,7 @@
<div class="modal" id="serverInformationModal" tabindex="-1" role="dialog" aria-labelledby="serverInformationModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
{{#let isList=(equals instance.container.mode.get "list")}}
{{#let isList=(eq instance.container.mode.get "list")}}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="serverInformationModalLabel">Server Information</h4>
@@ -1,17 +0,0 @@
Template.registerHelper('instance', function() {
return Template.instance();
});
Template.registerHelper('extend', function() {
const result = {};
const kw = arguments.pop();
_.each(arguments, function(current) {
if (typeof current !== 'object') {
return;
}
_.extend(result, current);
});
_.extend(result, kw.hash);
return result;
});
@@ -1,35 +0,0 @@
Template.registerHelper('choose', function() {
let result;
_.each(_.initial(arguments, 1), function(value) {
return value && (result = value);
});
return result;
});
Template.registerHelper('bool', function(value) {
return !!value;
});
Template.registerHelper('equals', function(a, b) {
return a === b;
});
Template.registerHelper('not', function(value) {
return !value;
});
Template.registerHelper('and', function() {
let result = true;
_.each(_.initial(arguments, 1), function(value) {
return value || (result = false);
});
return result;
});
Template.registerHelper('or', function() {
let result = false;
_.each(_.initial(arguments, 1), function(value) {
return value && (result = true);
});
return result;
});
@@ -1,7 +0,0 @@
Template.registerHelper('concat', function() {
let result = '';
_.each(_.initial(arguments, 1), function(value) {
result += value;
});
return result;
});
+5 -8
View File
@@ -39,18 +39,15 @@ class Form {
var propertyArray = key.split('.');
var currentObject = nestedObject;
while (propertyArray.length) {
var property = propertyArray.shift();
var isArray = property.slice(-2) === '[]';
var key = isArray ? property.slice(0, -2) : property;
var currentProperty = propertyArray.shift();
if (!propertyArray.length) {
currentObject[key] = value;
currentObject[currentProperty] = value;
} else {
if (!currentObject[key]) {
var dataStructure = isArray ? [] : {};
currentObject[key] = dataStructure;
if (!currentObject[currentProperty]) {
currentObject[currentProperty] = {};
}
currentObject = currentObject[key];
currentObject = currentObject[currentProperty];
}
}
}
-5
View File
@@ -58,11 +58,6 @@ Package.onUse(function(api) {
api.addFiles('client/tools.js', 'client');
// Spacebars helpers
api.addFiles('client/helpers/blaze.js', 'client');
api.addFiles('client/helpers/logical.js', 'client');
api.addFiles('client/helpers/string.js', 'client');
// Utility classes
api.addFiles('client/utils/form.js', 'client');