mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-05 20:51:33 +08:00
feat(sidebar): move note paths to sidebar
This commit is contained in:
parent
761ac680a3
commit
6081d93251
@ -190,7 +190,6 @@ export default class DesktopLayout {
|
||||
.ribbon(new BasicPropertiesWidget())
|
||||
.ribbon(new OwnedAttributeListWidget())
|
||||
.ribbon(new InheritedAttributesWidget())
|
||||
.ribbon(new NotePathsWidget())
|
||||
.ribbon(new NoteMapRibbonWidget())
|
||||
.ribbon(new SimilarNotesWidget())
|
||||
.ribbon(new NoteInfoWidget())
|
||||
@ -235,6 +234,7 @@ export default class DesktopLayout {
|
||||
)
|
||||
.child(
|
||||
new RightPaneContainer()
|
||||
.child(new NotePathsWidget())
|
||||
.child(new TocWidget())
|
||||
.child(new HighlightsListWidget())
|
||||
.child(...this.customWidgets.get("right-pane"))
|
||||
|
@ -1,10 +1,10 @@
|
||||
import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
||||
import treeService from "../../services/tree.js";
|
||||
import linkService from "../../services/link.js";
|
||||
import { t } from "../../services/i18n.js";
|
||||
import type FNote from "../../entities/fnote.js";
|
||||
import type { NotePathRecord } from "../../entities/fnote.js";
|
||||
import type { EventData } from "../../components/app_context.js";
|
||||
import RightPanelWidget from "../right_panel_widget.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="note-paths-widget">
|
||||
@ -39,7 +39,7 @@ const TPL = `
|
||||
<button class="btn btn-sm" data-trigger-command="cloneNoteIdsTo">${t("note_paths.clone_button")}</button>
|
||||
</div>`;
|
||||
|
||||
export default class NotePathsWidget extends NoteContextAwareWidget {
|
||||
export default class NotePathsWidget extends RightPanelWidget {
|
||||
|
||||
private $notePathIntro!: JQuery<HTMLElement>;
|
||||
private $notePathList!: JQuery<HTMLElement>;
|
||||
@ -52,20 +52,15 @@ export default class NotePathsWidget extends NoteContextAwareWidget {
|
||||
return "toggleRibbonTabNotePaths";
|
||||
}
|
||||
|
||||
getTitle() {
|
||||
return {
|
||||
show: true,
|
||||
title: t("note_paths.title"),
|
||||
icon: "bx bx-collection"
|
||||
};
|
||||
get widgetTitle() {
|
||||
return t("note_paths.title");
|
||||
}
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.contentSized();
|
||||
async doRenderBody() {
|
||||
this.$body.empty().append($(TPL));
|
||||
|
||||
this.$notePathIntro = this.$widget.find(".note-path-intro");
|
||||
this.$notePathList = this.$widget.find(".note-path-list");
|
||||
this.$notePathIntro = this.$body.find(".note-path-intro");
|
||||
this.$notePathList = this.$body.find(".note-path-list");
|
||||
}
|
||||
|
||||
async refreshWithNote(note: FNote) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user