feat(views/table): hide footer in search

This commit is contained in:
Elian Doran 2025-07-04 20:56:10 +03:00
parent 63537aff20
commit 4ded5e2b98
No known key found for this signature in database
2 changed files with 11 additions and 2 deletions

View File

@ -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")}

View File

@ -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();