diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.js index 38c2d3066..0cb1a1c80 100644 --- a/src/public/app/layouts/desktop_layout.js +++ b/src/public/app/layouts/desktop_layout.js @@ -190,7 +190,6 @@ export default class DesktopLayout { .ribbon(new BasicPropertiesWidget()) .ribbon(new OwnedAttributeListWidget()) .ribbon(new InheritedAttributesWidget()) - .ribbon(new NoteInfoWidget()) .button(new RevisionsButton()) .button(new NoteActionsWidget()) ) @@ -238,6 +237,7 @@ export default class DesktopLayout { .child(new BacklinksWidget()) .child(new NoteMapRibbonWidget()) .child(...this.customWidgets.get("right-pane")) + .child(new NoteInfoWidget()) ) ) ) diff --git a/src/public/app/widgets/ribbon_widgets/note_info_widget.ts b/src/public/app/widgets/ribbon_widgets/note_info_widget.ts index de24c5f33..45f9447a0 100644 --- a/src/public/app/widgets/ribbon_widgets/note_info_widget.ts +++ b/src/public/app/widgets/ribbon_widgets/note_info_widget.ts @@ -5,6 +5,7 @@ import server from "../../services/server.js"; import utils from "../../services/utils.js"; import type { EventData } from "../../components/app_context.js"; import type FNote from "../../entities/fnote.js"; +import RightPanelWidget from "../right_panel_widget.js"; const TPL = `
@@ -78,7 +79,7 @@ interface MetadataResponse { dateModified: number; } -export default class NoteInfoWidget extends NoteContextAwareWidget { +export default class NoteInfoWidget extends RightPanelWidget { private $noteId!: JQuery; private $dateCreated!: JQuery; @@ -90,6 +91,10 @@ export default class NoteInfoWidget extends NoteContextAwareWidget { private $subTreeSize!: JQuery; private $calculateButton!: JQuery; + get widgetTitle() { + return t("note_info_widget.title"); + } + get name() { return "noteInfo"; } @@ -102,29 +107,20 @@ export default class NoteInfoWidget extends NoteContextAwareWidget { return !!this.note; } - getTitle() { - return { - show: this.isEnabled(), - title: t("note_info_widget.title"), - icon: "bx bx-info-circle" - }; - } + async doRenderBody() { + this.$body.empty().append($(TPL)); - doRender() { - this.$widget = $(TPL); - this.contentSized(); + this.$noteId = this.$body.find(".note-info-note-id"); + this.$dateCreated = this.$body.find(".note-info-date-created"); + this.$dateModified = this.$body.find(".note-info-date-modified"); + this.$type = this.$body.find(".note-info-type"); + this.$mime = this.$body.find(".note-info-mime"); - this.$noteId = this.$widget.find(".note-info-note-id"); - this.$dateCreated = this.$widget.find(".note-info-date-created"); - this.$dateModified = this.$widget.find(".note-info-date-modified"); - this.$type = this.$widget.find(".note-info-type"); - this.$mime = this.$widget.find(".note-info-mime"); + this.$noteSizesWrapper = this.$body.find(".note-sizes-wrapper"); + this.$noteSize = this.$body.find(".note-size"); + this.$subTreeSize = this.$body.find(".subtree-size"); - this.$noteSizesWrapper = this.$widget.find(".note-sizes-wrapper"); - this.$noteSize = this.$widget.find(".note-size"); - this.$subTreeSize = this.$widget.find(".subtree-size"); - - this.$calculateButton = this.$widget.find(".calculate-button"); + this.$calculateButton = this.$body.find(".calculate-button"); this.$calculateButton.on("click", async () => { this.$noteSizesWrapper.show(); this.$calculateButton.hide();