Skip to content

Build your personal knowledge base with Trilium Notes

fix closing of tooltips

zadam225e893461f0
diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html
index c2704ceacd..edecc2636b 100644
--- a/docs/frontend_api/FrontendScriptApi.html
+++ b/docs/frontend_api/FrontendScriptApi.html
@@ -1452,7 +1452,7 @@
- <h4 class="name" id="getActiveNotePath"><span class="type-signature"></span>getActiveNotePath<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+ <h4 class="name" id="getActiveNotePath"><span class="type-signature"></span>getActiveNotePath<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
@@ -1538,7 +1538,7 @@
</dt>
<dd>
-<span class="param-type">string</span>
+<span class="param-type">Promise.&lt;string></span>
</dd>
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html
index eac242c9ff..39edef43a0 100644
--- a/docs/frontend_api/services_frontend_script_api.js.html
+++ b/docs/frontend_api/services_frontend_script_api.js.html
@@ -264,7 +264,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
/**
* @method
- * @returns {string} returns note path of active note
+ * @returns {Promise&lt;string>} returns note path of active note
*/
this.getActiveNotePath = treeService.getActiveNotePath;
diff --git a/src/public/javascripts/services/note_tooltip.js b/src/public/javascripts/services/note_tooltip.js
index cffa0a2db8..ac7da96c5c 100644
--- a/src/public/javascripts/services/note_tooltip.js
+++ b/src/public/javascripts/services/note_tooltip.js
@@ -7,8 +7,8 @@ function setupGlobalTooltip() {
$(document).on("mouseenter", "a", mouseEnterHandler);
$(document).on("mouseleave", "a", mouseLeaveHandler);
- // close any tooltip after click, this fixes the problem that sometimes tooltips remained on the screen
- //$(document).on("click", () => $('.tooltip').remove());
+ // close any note tooltip after click, this fixes the problem that sometimes tooltips remained on the screen
+ $(document).on("click", () => $('.note-tooltip').remove());
}
function setupElementTooltip($el) {
@@ -58,7 +58,8 @@ async function mouseEnterHandler() {
trigger: 'manual',
boundary: 'window',
title: html,
- html: true
+ html: true,
+ template: '<div class="tooltip note-tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>'
});
$(this).tooltip('show');