Check for builtin SVG's in mapping-icons
This commit is contained in:
parent
ec84cd11aa
commit
9202cbe8e2
1 changed files with 12 additions and 1 deletions
|
@ -17,6 +17,7 @@ import {
|
|||
} from "./Json/QuestionableTagRenderingConfigJson"
|
||||
import { FixedUiElement } from "../../UI/Base/FixedUiElement"
|
||||
import { Paragraph } from "../../UI/Base/Paragraph"
|
||||
import Svg from "../../Svg"
|
||||
|
||||
export interface Mapping {
|
||||
readonly if: UploadableTag
|
||||
|
@ -398,7 +399,17 @@ export default class TagRenderingConfig {
|
|||
let iconClass = commonSize
|
||||
if (mapping.icon !== undefined) {
|
||||
if (typeof mapping.icon === "string" && mapping.icon !== "") {
|
||||
icon = mapping.icon
|
||||
if (
|
||||
Svg.All[mapping.icon] !== undefined ||
|
||||
Svg.All[mapping.icon + ".svg"] !== undefined
|
||||
) {
|
||||
icon = "./assets/svg/" + mapping.icon
|
||||
if (!icon.endsWith(".svg")) {
|
||||
icon += ".svg"
|
||||
}
|
||||
} else {
|
||||
icon = mapping.icon
|
||||
}
|
||||
} else {
|
||||
icon = mapping.icon["path"]
|
||||
iconClass = mapping.icon["class"] ?? iconClass
|
||||
|
|
Loading…
Reference in a new issue