mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 18:16:36 +02:00
helpers.generateCategoryBackground
This commit is contained in:
@@ -43,6 +43,24 @@
|
||||
return JSON.stringify(obj).replace(/&/gm,"&").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) {
|
||||
|
||||
Reference in New Issue
Block a user