mirror of
https://github.com/alberti42/obsidian-plugins-annotations.git
synced 2026-07-22 10:10:24 +00:00
Style block
This commit is contained in:
parent
9b864412dc
commit
e7e6b8d977
2 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue