mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
prefix match for autocomplete attribute search
This commit is contained in:
@@ -4,13 +4,17 @@ const NoteSet = require('../note_set');
|
||||
const noteCache = require('../../note_cache/note_cache');
|
||||
|
||||
class AttributeExistsExp {
|
||||
constructor(attributeType, attributeName) {
|
||||
constructor(attributeType, attributeName, prefixMatch) {
|
||||
this.attributeType = attributeType;
|
||||
this.attributeName = attributeName;
|
||||
this.prefixMatch = prefixMatch;
|
||||
}
|
||||
|
||||
execute(noteSet) {
|
||||
const attrs = noteCache.findAttributes(this.attributeType, this.attributeName);
|
||||
const attrs = this.prefixMatch
|
||||
? noteCache.findAttributesWithPrefix(this.attributeType, this.attributeName)
|
||||
: noteCache.findAttributes(this.attributeType, this.attributeName);
|
||||
|
||||
const resultNoteSet = new NoteSet();
|
||||
|
||||
for (const attr of attrs) {
|
||||
|
||||
Reference in New Issue
Block a user