LT-249: Implementing behavior for 'comparison' and 'key timepoints' switch

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2016-07-22 11:08:27 +02:00
1 parent ef89c3dfd7
commit 048bb3f050
11 files changed
+136 -93

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
// Return the current template instance
Template.registerHelper('instance', () => {
return Template.instance();
});
// Create a new object and extends it with the argument objects
Template.registerHelper('extend', (...argsArray) => {
// Create the resulting object
const result = {};
// Extract the Spacebars kw hash
const kwHash = _.last(argsArray).hash;
// Extract the given objects
const objects = _.initial(argsArray);
// Iterate over the given objects
_.each(objects, current => {
// Stop here if the current argument is not an object
if (typeof current !== 'object') {
return;
}
// Extend the resulting object with the current argument object
_.extend(result, current);
});
// Extend the resulting object with the Spacebars kw hash
_.extend(result, kwHash);
// Return the resulting object
return result;
});
+1
View File
@@ -175,6 +175,7 @@ Package.onUse(function(api) {
// UI Helpers
api.addFiles([
'lib/helpers/formatDA.js',
'lib/helpers/blaze.js',
'lib/helpers/logical.js',
'lib/helpers/formatJSDate.js',
'lib/helpers/jsDateFromNow.js',