From 8b48a1e3af75c5bba42f2f5f4e3a3362f8bcbf90 Mon Sep 17 00:00:00 2001 From: Mega Date: Fri, 27 Mar 2015 14:51:36 +0300 Subject: [PATCH] fix: category images (helpers.generateCategoryBackground) --- public/src/modules/helpers.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js index a0201ed6cc..d9bc514aa3 100644 --- a/public/src/modules/helpers.js +++ b/public/src/modules/helpers.js @@ -57,19 +57,22 @@ 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 + ';'); + style.push('background-color: ' + category.bgColor); } if (category.color) { - style.push('color: ' + category.color + ';'); + style.push('color: ' + category.color); } - return style.join(' '); + if (category.backgroundImage) { + style.push('background-image: url(' + category.backgroundImage + ')'); + if (category.imageClass) { + style.push('background-size: ' + category.imageClass); + } + } + + return style.join('; ') + ';'; }; helpers.generateTopicClass = function(topic) {