trilium/src/public/javascripts/services/note_detail_search.js

32 lines
643 B
JavaScript
Raw Normal View History

import noteDetailService from "./note_detail.js";
const $searchString = $("#search-string");
const $noteDetailSearch = $('#note-detail-search');
function getContent() {
JSON.stringify({
searchString: $searchString.val()
});
}
2018-03-28 09:46:38 +08:00
function show() {
$noteDetailSearch.show();
try {
const json = JSON.parse(noteDetailService.getCurrentNote().content);
$searchString.val(json.searchString);
}
catch (e) {
console.log(e);
$searchString.val('');
}
$searchString.on('input', noteDetailService.noteChanged);
}
export default {
getContent,
2018-03-28 09:46:38 +08:00
show,
focus: () => null
}