Fix categoryColor for /categories view
And accept both categoryColor and categoryColour as special params.
This commit is contained in:
parent
b59c961f0a
commit
4c83914e87
|
@ -108,7 +108,7 @@ export default {
|
|||
let iconItem = getIconItem(category.slug);
|
||||
if (iconItem) {
|
||||
let itemColor = iconItem[2]
|
||||
? iconItem[2] == "categoryColour"
|
||||
? iconItem[2].match(/categoryColo(u*)r/)
|
||||
? `style="color: #${color}"`
|
||||
: `style="color: ${iconItem[2]}"`
|
||||
: "";
|
||||
|
@ -154,7 +154,11 @@ export default {
|
|||
html(attrs) {
|
||||
let iconItem = getIconItem(attrs.category.slug);
|
||||
if (iconItem) {
|
||||
let itemColor = iconItem[2] ? `color: ${iconItem[2]}` : "";
|
||||
let itemColor = iconItem[2]
|
||||
? iconItem[2].match(/categoryColo(u*)r/g)
|
||||
? `color: #${attrs.category.color}`
|
||||
: `color: ${iconItem[2]}`
|
||||
: "";
|
||||
let itemIcon = iconItem[1] != "" ? iconNode(iconItem[1]) : "";
|
||||
return h("span.category-icon", { style: itemColor }, itemIcon);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ category_icon_list:
|
|||
default: "help,question-circle,#CC0000,partial|"
|
||||
type: "list"
|
||||
list_type: "simple"
|
||||
description: 'Enter comma-delimited configuration for categories, in the format "slug,icon,colour,match". Colour in format #123456 or "categoryColour" to use the default colour for the category (same as the Badge colour). If match is "partial" then the slug need only partially match the category-slug, otherwise an exact match is required'
|
||||
description: 'Enter comma-delimited configuration for categories, in the format "slug,icon,color,match". Colour in format #123456 or "categoryColor" to use the default color for the category (same as the Badge color). If match is "partial" then the slug need only partially match the category-slug, otherwise an exact match is required'
|
||||
svg_icons:
|
||||
default: "question-circle"
|
||||
type: "list"
|
||||
|
|
Loading…
Reference in New Issue