Replace innerText method for OPEN_NEW_CONTAINER_PICKER function
This commit is contained in:
parent
8adfaecd81
commit
4651dfe2eb
2 changed files with 23 additions and 11 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 417e6294ed767914b617a5e56ccbe67482df181c
|
Subproject commit 7237ccf8d08ea4afaae374def59360671b01ace0
|
|
@ -1125,20 +1125,32 @@ Logic.registerPanel(OPEN_NEW_CONTAINER_PICKER, {
|
||||||
const tr = document.createElement("tr");
|
const tr = document.createElement("tr");
|
||||||
tr.classList.add("menu-item", "hover-highlight", "keyboard-nav");
|
tr.classList.add("menu-item", "hover-highlight", "keyboard-nav");
|
||||||
tr.setAttribute("tabindex", "0");
|
tr.setAttribute("tabindex", "0");
|
||||||
|
|
||||||
|
// Create <td>
|
||||||
const td = document.createElement("td");
|
const td = document.createElement("td");
|
||||||
|
|
||||||
td.innerHTML = Utils.escaped`
|
// Create <div class="menu-icon">
|
||||||
<div class="menu-icon">
|
const divMenuIcon = document.createElement("div");
|
||||||
<div class="usercontext-icon"
|
divMenuIcon.classList.add("menu-icon");
|
||||||
data-identity-icon="${identity.icon}"
|
|
||||||
data-identity-color="${identity.color}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<span class="menu-text">${identity.name}</span>`;
|
|
||||||
|
|
||||||
fragment.appendChild(tr);
|
// Create <div class="usercontext-icon" data-identity-icon="${identity.icon}" data-identity-color="${identity.color}"></div>
|
||||||
|
const divUsercontextIcon = document.createElement("div");
|
||||||
|
divUsercontextIcon.classList.add("usercontext-icon");
|
||||||
|
divUsercontextIcon.setAttribute("data-identity-icon", identity.icon);
|
||||||
|
divUsercontextIcon.setAttribute("data-identity-color", identity.color);
|
||||||
|
|
||||||
|
// Create <span class="menu-text">${identity.name}</span>`;
|
||||||
|
const spanMenuText = document.createElement("span");
|
||||||
|
spanMenuText.classList.add("menu-text");
|
||||||
|
spanMenuText.textContent = identity.name;
|
||||||
|
|
||||||
|
// Append Children
|
||||||
|
// fragment > tr > td > (divMenuIcon > divMenuIcon) | spanMenuText
|
||||||
|
divMenuIcon.appendChild(divUsercontextIcon);
|
||||||
|
td.appendChild(divMenuIcon);
|
||||||
|
td.appendChild(spanMenuText);
|
||||||
tr.appendChild(td);
|
tr.appendChild(td);
|
||||||
|
fragment.appendChild(tr);
|
||||||
|
|
||||||
Utils.addEnterHandler(tr, () => {
|
Utils.addEnterHandler(tr, () => {
|
||||||
pickedFunction(identity);
|
pickedFunction(identity);
|
||||||
|
|
Loading…
Add table
Reference in a new issue