From e7e6b8d977142ca849bc388e9699188e83b1e446 Mon Sep 17 00:00:00 2001 From: Andrea Alberti Date: Fri, 28 Jun 2024 21:25:42 +0200 Subject: [PATCH] Style block --- src/main.ts | 3 +++ styles/styles.css | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 8a99dd3..3712422 100644 --- a/src/main.ts +++ b/src/main.ts @@ -156,6 +156,7 @@ export default class PluginsAnnotations extends Plugin { if(isPlaceholder) { comment.classList.add('plugin-comment-placeholder'); + comment_container.style.display = 'none'; } comment.innerText = initialText; @@ -165,6 +166,7 @@ export default class PluginsAnnotations extends Plugin { if (isPlaceholder) { // comment.innerText = ''; comment.classList.remove('plugin-comment-placeholder'); + comment_container.style.display = 'block'; const range = document.createRange(); range.selectNodeContents(comment); const selection = window.getSelection(); @@ -180,6 +182,7 @@ export default class PluginsAnnotations extends Plugin { if (isPlaceholder || comment.innerText.trim() === '') { comment.innerText = placeholder; comment.classList.add('plugin-comment-placeholder'); + comment_container.style.display = 'none'; isPlaceholder = true; } }); diff --git a/styles/styles.css b/styles/styles.css index 1dcf9f0..17d992b 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -9,10 +9,10 @@ .plugin-comment-annotation.plugin-comment-placeholder { color: #CCCCCC; /* Standard placeholder color */ font-style: italic; - display: none; } -/* Show placeholder when hovering over the plugin container */ +/* Show comment container when hovering over the plugin container */ +.setting-item:hover .plugin-comment, .setting-item:hover .plugin-comment-placeholder { display: block; }