|
@@ -126,6 +126,7 @@
|
|
|
let showDeleteConfirm = false;
|
|
|
let showAccessControlModal = false;
|
|
|
|
|
|
+ let ignoreBlur = false;
|
|
|
let titleInputFocused = false;
|
|
|
let titleGenerating = false;
|
|
|
|
|
@@ -970,7 +971,8 @@ Provide the enhanced notes in markdown format. Use markdown syntax for headings,
|
|
|
}}
|
|
|
on:blur={(e) => {
|
|
|
// check if target is generate button
|
|
|
- if (e.relatedTarget?.id === 'generate-title-button') {
|
|
|
+ if (ignoreBlur) {
|
|
|
+ ignoreBlur = false;
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -987,6 +989,11 @@ Provide the enhanced notes in markdown format. Use markdown syntax for headings,
|
|
|
<button
|
|
|
class=" self-center dark:hover:text-white transition"
|
|
|
id="generate-title-button"
|
|
|
+ disabled={(note?.user_id !== $user?.id && $user?.role !== 'admin') ||
|
|
|
+ titleGenerating}
|
|
|
+ on:mouseenter={() => {
|
|
|
+ ignoreBlur = true;
|
|
|
+ }}
|
|
|
on:click={(e) => {
|
|
|
e.preventDefault();
|
|
|
e.stopImmediatePropagation();
|