mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
small fixes to saved search
This commit is contained in:
parent
0b38e24185
commit
4d4d9f2000
@ -3,6 +3,7 @@ import toastService from "../services/toast.js";
|
|||||||
import appContext from "../services/app_context.js";
|
import appContext from "../services/app_context.js";
|
||||||
import noteCreateService from "../services/note_create.js";
|
import noteCreateService from "../services/note_create.js";
|
||||||
import utils from "../services/utils.js";
|
import utils from "../services/utils.js";
|
||||||
|
import treeCache from "../services/tree_cache.js";
|
||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<div class="search-box">
|
<div class="search-box">
|
||||||
@ -105,14 +106,13 @@ export default class SearchBoxWidget extends BasicWidget {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME
|
let parent = appContext.tabManager.getActiveTabNote();
|
||||||
let activeNote = appContext.tabManager.getActiveTabNote();
|
|
||||||
|
|
||||||
if (activeNote.type === 'search') {
|
if (parent.type === 'search') {
|
||||||
activeNote = activeNote.getParentNotes()[0];
|
parent = await treeCache.getNote('root');
|
||||||
}
|
}
|
||||||
|
|
||||||
await noteCreateService.createNote(activeNote.noteId, {
|
await noteCreateService.createNote(parent.noteId, {
|
||||||
type: "search",
|
type: "search",
|
||||||
mime: "application/json",
|
mime: "application/json",
|
||||||
title: searchString,
|
title: searchString,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import TypeWidget from "./type_widget.js";
|
import TypeWidget from "./type_widget.js";
|
||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<div class="note-detail-search note-detail-printable">
|
<div class="note-detail-search note-detail-printable" style="padding: 20px;">
|
||||||
<div style="display: flex; align-items: center; margin-right: 20px; margin-top: 15px;">
|
<div style="display: flex; align-items: center; margin-right: 20px; margin-top: 15px;">
|
||||||
<strong>Search string: </strong>
|
<strong>Search string: </strong>
|
||||||
<textarea rows="4" style="width: auto !important; flex-grow: 4" class="search-string form-control"></textarea>
|
<textarea rows="4" style="width: auto !important; flex-grow: 4" class="search-string form-control"></textarea>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user