diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js index 9f643d8736..e09534b55d 100644 --- a/public/src/modules/helpers.js +++ b/public/src/modules/helpers.js @@ -43,6 +43,24 @@ return JSON.stringify(obj).replace(/&/gm,"&").replace(//gm,">").replace(/"/g, '"'); }; + helpers.generateCategoryBackground = function(category) { + var style = []; + + if (category.backgroundImage) { + style.push('background-image: url(' + category.backgroundImage + ')'); + } + + if (category.bgColor) { + style.push('background-color: ' + category.bgColor + ';'); + } + + if (category.color) { + style.push('color: ' + category.color + ';'); + } + + return style.join(' '); + }; + // Groups helpers helpers.membershipBtn = function(groupObj) { if (groupObj.isMember) {