mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 00:05:50 +01:00
fixed history navigation buttons
This commit is contained in:
@@ -87,5 +87,6 @@ export default class AbstractButtonWidget extends NoteContextAwareWidget {
|
||||
|
||||
onContextMenu(handler) {
|
||||
this.settings.onContextMenu = handler;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import AbstractHistoryNavigationWidget from "./abstract_history.js";
|
||||
|
||||
export default class BackInHistoryButtonWidget extends AbstractHistoryNavigationWidget {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.icon('bx-left-arrow-circle')
|
||||
.title("Go to previous note.")
|
||||
.command("backInNoteHistory")
|
||||
.titlePlacement("right")
|
||||
.buttonNoteIdProvider(() => 'lbBackInHistory')
|
||||
.onContextMenu(e => this.showContextMenu(e));
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import AbstractHistoryNavigationWidget from "./abstract_history.js";
|
||||
|
||||
export default class ForwardInHistoryButtonWidget extends AbstractHistoryNavigationWidget {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.icon('bx-left-arrow-circle')
|
||||
.title("Go to next note.")
|
||||
.command("forwardInNoteHistory")
|
||||
.titlePlacement("right")
|
||||
.buttonNoteIdProvider(() => 'lbForwardInHistory')
|
||||
.onContextMenu(e => this.showContextMenu(e));
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,21 @@
|
||||
import utils from "../../../services/utils.js";
|
||||
import contextMenu from "../../../menus/context_menu.js";
|
||||
import treeService from "../../../services/tree.js";
|
||||
import ButtonFromNoteWidget from "../button_from_note.js";
|
||||
import utils from "../../services/utils.js";
|
||||
import contextMenu from "../../menus/context_menu.js";
|
||||
import treeService from "../../services/tree.js";
|
||||
import ButtonFromNoteWidget from "./button_from_note.js";
|
||||
|
||||
export default class HistoryNavigationButton extends ButtonFromNoteWidget {
|
||||
constructor(launcherNote, command) {
|
||||
super();
|
||||
|
||||
this.title(() => launcherNote.title)
|
||||
.icon(() => launcherNote.getIcon())
|
||||
.command(() => command)
|
||||
.titlePlacement("right")
|
||||
.buttonNoteIdProvider(() => launcherNote.noteId)
|
||||
.onContextMenu(e => this.showContextMenu(e))
|
||||
.class("launcher-button");
|
||||
}
|
||||
|
||||
export default class AbstractHistoryNavigationWidget extends ButtonFromNoteWidget {
|
||||
isEnabled() {
|
||||
return super.isEnabled() && utils.isElectron();
|
||||
}
|
||||
Reference in New Issue
Block a user