add ui-icon
className.
This commit is contained in:
parent
d296dd01fd
commit
1a7aa1ab66
@ -26,6 +26,7 @@ export function changeIcon(svg, type, id) {
|
||||
|
||||
export function createIcon(type, id, style) {
|
||||
const svg = document.createElementNS(svgns, 'svg');
|
||||
svg.classList.add('ui-icon');
|
||||
svg.appendChild(createUse(type, id));
|
||||
if (style != null) {
|
||||
for (let css of Object.entries(style)) {
|
||||
@ -38,6 +39,7 @@ export function createIcon(type, id, style) {
|
||||
export function resolveIcon(container) {
|
||||
const svgs = container.querySelectorAll('svg[data-id]');
|
||||
for (let icon of svgs) {
|
||||
icon.classList.add('ui-icon');
|
||||
const type = icon.dataset.type;
|
||||
const id = icon.dataset.id;
|
||||
icon.replaceChildren(createUse(type, id));
|
||||
|
Loading…
x
Reference in New Issue
Block a user