mirror of
https://github.com/zadam/trilium.git
synced 2025-10-02 03:24:53 +08:00
feat(views/table): hide all buttons in relation editor
This commit is contained in:
parent
282aed22b5
commit
aba3b5cb19
2 changed files with 9 additions and 3 deletions
|
@ -40,7 +40,10 @@ interface Options {
|
||||||
allowCreatingNotes?: boolean;
|
allowCreatingNotes?: boolean;
|
||||||
allowJumpToSearchNotes?: boolean;
|
allowJumpToSearchNotes?: boolean;
|
||||||
allowExternalLinks?: boolean;
|
allowExternalLinks?: boolean;
|
||||||
|
/** If set, hides the right-side button corresponding to go to selected note. */
|
||||||
hideGoToSelectedNoteButton?: boolean;
|
hideGoToSelectedNoteButton?: boolean;
|
||||||
|
/** If set, hides all right-side buttons in the autocomplete dropdown */
|
||||||
|
hideAllButtons?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function autocompleteSourceForCKEditor(queryText: string) {
|
async function autocompleteSourceForCKEditor(queryText: string) {
|
||||||
|
@ -190,9 +193,11 @@ function initNoteAutocomplete($el: JQuery<HTMLElement>, options?: Options) {
|
||||||
|
|
||||||
const $goToSelectedNoteButton = $("<a>").addClass("input-group-text go-to-selected-note-button bx bx-arrow-to-right");
|
const $goToSelectedNoteButton = $("<a>").addClass("input-group-text go-to-selected-note-button bx bx-arrow-to-right");
|
||||||
|
|
||||||
$el.after($clearTextButton).after($showRecentNotesButton).after($fullTextSearchButton);
|
if (!options.hideAllButtons) {
|
||||||
|
$el.after($clearTextButton).after($showRecentNotesButton).after($fullTextSearchButton);
|
||||||
|
}
|
||||||
|
|
||||||
if (!options.hideGoToSelectedNoteButton) {
|
if (!options.hideGoToSelectedNoteButton && !options.hideAllButtons) {
|
||||||
$el.after($goToSelectedNoteButton);
|
$el.after($goToSelectedNoteButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,8 @@ export function RelationEditor(cell: CellComponent, onRendered, success, cancel,
|
||||||
//set focus on the select box when the editor is selected
|
//set focus on the select box when the editor is selected
|
||||||
onRendered(function(){
|
onRendered(function(){
|
||||||
note_autocomplete.initNoteAutocomplete($editor, {
|
note_autocomplete.initNoteAutocomplete($editor, {
|
||||||
allowCreatingNotes: true
|
allowCreatingNotes: true,
|
||||||
|
hideAllButtons: true
|
||||||
}).on("autocomplete:noteselected", (event, suggestion, dataset) => {
|
}).on("autocomplete:noteselected", (event, suggestion, dataset) => {
|
||||||
const notePath = suggestion.notePath;
|
const notePath = suggestion.notePath;
|
||||||
if (!notePath) {
|
if (!notePath) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue