mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 01:36:24 +01:00
clear any event listener added in previous invocation of this function
This commit is contained in:
@@ -67,6 +67,9 @@ function showRecentNotes($el) {
|
||||
|
||||
function initNoteAutocomplete($el, options) {
|
||||
if ($el.hasClass("note-autocomplete-input") || utils.isMobile()) {
|
||||
// clear any event listener added in previous invocation of this function
|
||||
$el.off('autocomplete:noteselected');
|
||||
|
||||
return $el;
|
||||
}
|
||||
|
||||
@@ -157,6 +160,9 @@ function initNoteAutocomplete($el, options) {
|
||||
}
|
||||
});
|
||||
|
||||
// clear any event listener added in previous invocation of this function
|
||||
$el.off('autocomplete:noteselected');
|
||||
|
||||
return $el;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user