diff --git a/apps/client/src/widgets/ribbon_widgets/book_properties.ts b/apps/client/src/widgets/ribbon_widgets/book_properties.ts index 9dd25c3ee..39c4e92b2 100644 --- a/apps/client/src/widgets/ribbon_widgets/book_properties.ts +++ b/apps/client/src/widgets/ribbon_widgets/book_properties.ts @@ -3,7 +3,8 @@ import attributeService from "../../services/attributes.js"; import { t } from "../../services/i18n.js"; import type FNote from "../../entities/fnote.js"; import type { EventData } from "../../components/app_context.js"; -import { bookPropertiesConfig, renderBookProperty } from "./book_properties_config.js"; +import { bookPropertiesConfig, BookProperty } from "./book_properties_config.js"; +import attributes from "../../services/attributes.js"; const TPL = /*html*/`
@@ -98,10 +99,7 @@ export default class BookPropertiesWidget extends NoteContextAwareWidget { const bookPropertiesData = bookPropertiesConfig[viewType]; if (bookPropertiesData) { for (const property of bookPropertiesData.properties) { - this.$propertiesContainer.append(renderBookProperty(property, { - note: this.note, - triggerCommand: this.triggerCommand.bind(this) - })); + this.$propertiesContainer.append(this.renderBookProperty(property)); this.labelsToWatch.push(property.bindToLabel); } } @@ -126,4 +124,54 @@ export default class BookPropertiesWidget extends NoteContextAwareWidget { this.refresh(); } } + + renderBookProperty(property: BookProperty) { + const $container = $("
"); + const note = this.note; + if (!note) { + return $container; + } + switch (property.type) { + case "checkbox": + const $label = $("