From 5b575d66e3568a06c1c8f6849526a3bd15a3fd3a Mon Sep 17 00:00:00 2001 From: alexanderroese Date: Tue, 16 Jul 2024 23:27:07 +0200 Subject: [PATCH] emoji picker --- snippets/shx-3d-render-input.liquid | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/snippets/shx-3d-render-input.liquid b/snippets/shx-3d-render-input.liquid index cbd67df..c859073 100644 --- a/snippets/shx-3d-render-input.liquid +++ b/snippets/shx-3d-render-input.liquid @@ -154,7 +154,7 @@ opacity: 0; } - .shx-emoji-picker-popup:not(.shown) { + #shx-emoji-picker-popup:not(.shown) { display: none; } @@ -543,7 +543,9 @@ } 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"); emojiPicker.classList = "light"; emojiPicker.style.width = "100%"; @@ -552,12 +554,10 @@ insertText(document.querySelector("#shx-text1"), e.detail.unicode); }); - console.log("add picker"); - - document.getElementsByClassName("shx-emoji-picker-popup")[0].appendChild(emojiPicker); + emojiPickupPopup.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) { @@ -588,7 +588,7 @@ -
+
`; }