mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
feat(mobile): add back/forward buttons to launch bar
This commit is contained in:
parent
65a14c62ac
commit
de7248b7ce
@ -16,23 +16,17 @@ export default class HistoryNavigationButton extends ButtonFromNoteWidget {
|
|||||||
.class("launcher-button");
|
.class("launcher-button");
|
||||||
}
|
}
|
||||||
|
|
||||||
isEnabled() {
|
|
||||||
return super.isEnabled() && utils.isElectron();
|
|
||||||
}
|
|
||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
super.doRender();
|
super.doRender();
|
||||||
|
|
||||||
if (!utils.isElectron()) {
|
if (utils.isElectron()) {
|
||||||
return;
|
this.webContents = utils.dynamicRequire('@electron/remote').getCurrentWebContents();
|
||||||
|
|
||||||
|
// without this, the history is preserved across frontend reloads
|
||||||
|
this.webContents.clearHistory();
|
||||||
|
|
||||||
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.webContents = utils.dynamicRequire('@electron/remote').getCurrentWebContents();
|
|
||||||
|
|
||||||
// without this, the history is preserved across frontend reloads
|
|
||||||
this.webContents.clearHistory();
|
|
||||||
|
|
||||||
this.refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async showContextMenu(e) {
|
async showContextMenu(e) {
|
||||||
|
@ -277,7 +277,13 @@ function buildHiddenSubtreeDefinition(): Item {
|
|||||||
icon: 'bx-show',
|
icon: 'bx-show',
|
||||||
isExpanded: true,
|
isExpanded: true,
|
||||||
attributes: [ { type: 'label', name: 'docName', value: 'launchbar_intro' } ],
|
attributes: [ { type: 'label', name: 'docName', value: 'launchbar_intro' } ],
|
||||||
children: []
|
children: [
|
||||||
|
{ id: '_lbMobileBackInHistory', title: t("hidden-subtree.go-to-previous-note-title"), type: 'launcher', builtinWidget: 'backInHistoryButton', icon: 'bx bxs-chevron-left',
|
||||||
|
attributes: [ { type: 'label', name: 'docName', value: 'launchbar_history_navigation' } ]},
|
||||||
|
{ id: '_lbMobileForwardInHistory', title: t("hidden-subtree.go-to-next-note-title"), type: 'launcher', builtinWidget: 'forwardInHistoryButton', icon: 'bx bxs-chevron-right',
|
||||||
|
attributes: [ { type: 'label', name: 'docName', value: 'launchbar_history_navigation' } ]},
|
||||||
|
{ id: '_lbMobileSpacerEnd', title: t("hidden-subtree.spacer-title"), type: 'launcher', builtinWidget: 'spacer', baseSize: "0", growthFactor: "1" },
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user