LT-253: Creating select2 component

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2016-07-22 11:12:04 +02:00
1 parent 9d31b49997
commit 8564c52981
31 files changed
+123 -492

No files matched your search

+10 -9
View File
@@ -46,14 +46,15 @@ Template.registerHelper('clone', (...argsArray) => {
return extend(...newArgs);
});
// Return the first thrut value in the given arguments
Template.registerHelper('choose', (...argsArray) => {
// Iterate over the given objects
for (let i = 0; i < argsArray.length; i++) {
// Check if the current value is truth
if (!!argsArray[i]) {
// Return the current value
return argsArray[i];
// Choose the first truthy value in the given values
Template.registerHelper('choose', (...values) => {
let result;
_.each(_.initial(values, 1), value => {
if (result) {
return;
}
}
result = value;
});
return result;
});