Style block

This commit is contained in:
Andrea Alberti 2024-06-28 21:25:42 +02:00
parent 9b864412dc
commit e7e6b8d977
2 changed files with 5 additions and 2 deletions

View file

@ -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;
}
});

View file

@ -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;
}