mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
fix: do not rely on the hasChildNodes()
method
Introduced in 5ba1c28408
TIL: `hasChildNodes()` is sensitive to white spaces.
This commit is contained in:
parent
5ba1c28408
commit
c240357922
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@
|
|||
const button = event.target.closest('button')
|
||||
button.nextElementSibling.showModal()
|
||||
const mapId = button.dataset.mapId
|
||||
if (!document.querySelector(`#${mapId}_target`).hasChildNodes()) {
|
||||
if (!document.querySelector(`#${mapId}_target`).children.length) {
|
||||
const previewSettings = JSON.parse(document.getElementById(mapId).textContent)
|
||||
const map = new U.Map(`${mapId}_target`, previewSettings)
|
||||
CACHE[mapId] = map
|
||||
|
|
Loading…
Reference in a new issue