diff --git a/src/components/SubtitleDialog.vue b/src/components/SubtitleDialog.vue index c679e0d..eb52a24 100644 --- a/src/components/SubtitleDialog.vue +++ b/src/components/SubtitleDialog.vue @@ -202,7 +202,8 @@ export default defineComponent({ branding: false, toolbar_mode: "wrap", toolbar: - "fullscreen | code undo redo restoredraft | cut copy paste pastetext | fontsize| forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright alignjustify |subscript superscript removeformat", + // "fullscreen | code undo redo restoredraft | cut copy paste pastetext | fontsize| forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright alignjustify |subscript superscript removeformat", + "fullscreen | fontsize| forecolor backcolor bold italic underline strikethrough | subscript superscript removeformat", }); return { @@ -228,13 +229,30 @@ export default defineComponent({ loading.value = false; }, onShow() { - document.querySelectorAll(".tox ").forEach((item) => { - if (item && item.classList.contains("tox-tinymce-aux")) { - DomUtil.css(item, { - zIndex: "99999", - }); - } - }); + let success = false; + const checkZIndex = () => { + document.querySelectorAll(".tox ").forEach((item) => { + if (item && item.classList.contains("tox-tinymce-aux")) { + DomUtil.css(item, { + zIndex: "99999", + }); + success = true; + } + }); + }; + + const checkZIndexAsync = () => { + checkZIndex(); + setTimeout(() => { + if (!success) { + checkZIndexAsync(); + } else { + console.log("subtitle initialize success"); + } + }, 50); + }; + + checkZIndexAsync(); }, resetData() { loading.value = false;