Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
note autocompletes now have clear text button
azivner25e68762fec2
diff --git a/src/public/javascripts/services/note_autocomplete.js b/src/public/javascripts/services/note_autocomplete.jsindex 494ab51ded..bc859964ae 100644--- a/src/public/javascripts/services/note_autocomplete.js+++ b/src/public/javascripts/services/note_autocomplete.js@@ -16,6 +16,10 @@ async function autocompleteSource(term, cb) {cb(result);}+function clearText($el) {+ $el.val('').change();+}+function showRecentNotes($el) {$el.autocomplete("val", "");$el.autocomplete("open");@@ -23,12 +27,20 @@ function showRecentNotes($el) {function initNoteAutocomplete($el) {if (!$el.hasClass("aa-input")) {- const $showRecentNotesButton = $("<div>").addClass("input-group-append").append(- $("<span>")+ const $clearTextButton = $("<span>")+ .addClass("input-group-text input-clearer-button jam jam-close")+ .prop("title", "Clear text field");++ const $showRecentNotesButton = $("<span>").addClass("input-group-text show-recent-notes-button jam jam-clock")- .prop("title", "Show recent notes"));+ .prop("title", "Show recent notes");++ $el.after($("<div>")+ .addClass("input-group-append")+ .append($clearTextButton)+ .append($showRecentNotesButton));- $el.after($showRecentNotesButton);+ $clearTextButton.click(() => clearText($el));$showRecentNotesButton.click(() => showRecentNotes($el));diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.cssindex 2d56243e09..f105d14bb3 100644--- a/src/public/stylesheets/style.css+++ b/src/public/stylesheets/style.css@@ -451,6 +451,20 @@ html.theme-dark body {.show-recent-notes-button {cursor: pointer;font-size: 1.3em;+ padding-left: 7px;+ padding-right: 7px;+}++.input-clearer-button {+ cursor: pointer;+ font-size: 1.3em;+ background: inherit !important;+ padding-left: 5px;+ padding-right: 7px;+}++.promoted-attribute-input.aa-input {+ border-right: 0;}table.promoted-attributes-in-tooltip {