diff --git a/lib/ui/checkbox.js b/lib/ui/checkbox.js index b9625f7..1ddb19d 100644 --- a/lib/ui/checkbox.js +++ b/lib/ui/checkbox.js @@ -6,7 +6,7 @@ function fillCheckbox(container, type, label, charactor = 'check') { container.appendChild( createElement('layer', 'check-box-inner', createIcon(type, charactor)) ); - if (label instanceof HTMLElement) { + if (label instanceof Element) { container.appendChild(label); } else if (label?.length > 0) { container.appendChild( diff --git a/lib/ui/icon.js b/lib/ui/icon.js index 04a6920..4c085c2 100644 --- a/lib/ui/icon.js +++ b/lib/ui/icon.js @@ -10,7 +10,7 @@ function createUse(type, id) { } function changeIcon(svg, type, id) { - if (svg instanceof HTMLElement) { + if (svg instanceof SVGElement) { svg.replaceChildren(createUse(type, id)); } return svg; diff --git a/lib/ui/popup.html b/lib/ui/popup.html index 977ab2b..ccb0645 100644 --- a/lib/ui/popup.html +++ b/lib/ui/popup.html @@ -38,6 +38,7 @@ onResizeEnded: () => console.log('resize ended.', popup.rect) }); popup.show(); + window.popup = popup; });