mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
feat(views/table): hide footer in search
This commit is contained in:
parent
63537aff20
commit
4ded5e2b98
@ -1,6 +1,15 @@
|
||||
import FNote from "../../../entities/fnote.js";
|
||||
import { t } from "../../../services/i18n.js";
|
||||
|
||||
export default function buildFooter() {
|
||||
function shouldDisplayFooter(parentNote: FNote) {
|
||||
return (parentNote.type !== "search");
|
||||
}
|
||||
|
||||
export default function buildFooter(parentNote: FNote) {
|
||||
if (!shouldDisplayFooter(parentNote)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return /*html*/`\
|
||||
<button class="btn btn-sm" style="padding: 0px 10px 0px 10px;" data-trigger-command="addNewRow">
|
||||
<span class="bx bx-plus"></span> ${t("table_view.new-row")}
|
||||
|
@ -135,7 +135,7 @@ export default class TableView extends ViewMode<StateInfo> {
|
||||
persistence: true,
|
||||
movableColumns: true,
|
||||
movableRows,
|
||||
footerElement: buildFooter(),
|
||||
footerElement: buildFooter(this.parentNote),
|
||||
persistenceWriterFunc: (_id, type: string, data: object) => {
|
||||
this.persistentData[type] = data;
|
||||
this.spacedUpdate.scheduleUpdate();
|
||||
|
Loading…
x
Reference in New Issue
Block a user