Skip to content

Commit

Permalink
Add name to meta-data
Browse files Browse the repository at this point in the history
  • Loading branch information
aothms committed Nov 27, 2024
1 parent ba1b4f6 commit c668257
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/viewer/render.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function buildDomTree(prim, node) {
Object.entries(icons).forEach(([k, v]) => span.innerText += (prim.attributes || {})[k] ? v : ' ');
span.className = "material-symbols-outlined";
elem.onclick = (evt) => {
let rows = Object.entries(prim.attributes).map(([k, v]) => `<tr><td>${encodeHtmlEntities(k)}</td><td>${encodeHtmlEntities(typeof v === 'object' ? JSON.stringify(v) : v)}</td>`).join('');
let rows = [['name', prim.name]].concat(Object.entries(prim.attributes)).map(([k, v]) => `<tr><td>${encodeHtmlEntities(k)}</td><td>${encodeHtmlEntities(typeof v === 'object' ? JSON.stringify(v) : v)}</td>`).join('');
document.querySelector('.attributes .table').innerHTML = `<table border="0">${rows}</table>`;
evt.stopPropagation();
};
Expand Down

0 comments on commit c668257

Please sign in to comment.