emoji picker

main
alexanderroese 2024-07-16 23:27:07 +02:00
parent 2cd7287c4a
commit 5b575d66e3
1 changed files with 7 additions and 7 deletions

View File

@ -154,7 +154,7 @@
opacity: 0; opacity: 0;
} }
.shx-emoji-picker-popup:not(.shown) { #shx-emoji-picker-popup:not(.shown) {
display: none; display: none;
} }
</style> </style>
@ -543,7 +543,9 @@
} }
function onClickEmojiPickerButton() { function onClickEmojiPickerButton() {
if (document.getElementsByClassName("shx-emoji-picker-popup")[0].childNodes.length === 0) { const emojiPickupPopup = document.getElementById("shx-emoji-picker-popup")
if (emojiPickupPopup.childNodes.length === 0) {
const emojiPicker = document.createElement("emoji-picker"); const emojiPicker = document.createElement("emoji-picker");
emojiPicker.classList = "light"; emojiPicker.classList = "light";
emojiPicker.style.width = "100%"; emojiPicker.style.width = "100%";
@ -552,12 +554,10 @@
insertText(document.querySelector("#shx-text1"), e.detail.unicode); insertText(document.querySelector("#shx-text1"), e.detail.unicode);
}); });
console.log("add picker"); emojiPickupPopup.appendChild(emojiPicker);
document.getElementsByClassName("shx-emoji-picker-popup")[0].appendChild(emojiPicker);
} }
document.querySelector('.shx-emoji-picker-popup').classList.toggle('shown') emojiPickupPopup.classList.toggle('shown')
} }
function SHX_IFC_genTextInput(inputID, labelText, inputName, inputVal, section_id, maxLength = 24) { function SHX_IFC_genTextInput(inputID, labelText, inputName, inputVal, section_id, maxLength = 24) {
@ -588,7 +588,7 @@
</div> </div>
</div> </div>
<div class="shx-emoji-picker-popup"></div> <div id="shx-emoji-picker-popup"></div>
`; `;
} }